return -1;
makes all the other slots except the declared ones -1
|
I want to make it so only one equipment slot is an override,
Itemconstant.java
When I try this code the rest of the player's body is invisible ...Code:public static int get200milHerb(int slot, boolean male) { switch (slot) { case Equipment.SLOT_CAPE: return male ? 90121 : 90121; } return -1; }
return -1;
makes all the other slots except the declared ones -1
For the rest, you're returning -1. So make it return the slot. Example:
Code:public static int get200milHerb(int slot, boolean male) { switch (slot) { case Equipment.SLOT_CAPE: return male ? 90121 : 90121; } return get(slot); }
Thanks both of you!
you can also rebuild your switch statement to an if statement which will not result in a default return value that removes everything else (you can also make more cases in your switch for other slots - might take a lot of work / all slots should be assigned values).
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |