-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
bugDenotes that this a bugDenotes that this a bughigh priorityhigh priority, needs to be done soonhigh priority, needs to be done soon
Description
int varcIntValue = methods.client.getVarcIntValue(VarcIntIndices.CURRENT_INTERFACE_TAB);
return switch (VarcIntValues.valueOf(varcIntValue)) {
case TAB_COMBAT_OPTIONS -> InterfaceTab.COMBAT;
case TAB_SKILLS -> InterfaceTab.SKILLS;
case TAB_QUEST_LIST -> InterfaceTab.QUESTS;
case TAB_INVENTORY -> InterfaceTab.INVENTORY;
case TAB_WORN_EQUIPMENT -> InterfaceTab.EQUIPMENT;
case TAB_PRAYER -> InterfaceTab.PRAYER;
case TAB_SPELLBOOK -> InterfaceTab.MAGIC;
case TAB_FRIEND_LIST -> InterfaceTab.FRIENDS;
case TAB_LOGOUT -> InterfaceTab.LOGOUT;
case TAB_SETTINGS -> InterfaceTab.SETTINGS;
case TAB_MUSIC -> InterfaceTab.MUSIC;
case TAB_CHAT_CHANNEL -> InterfaceTab.CHAT;
case TAB_ACC_MANAGEMENT -> InterfaceTab.ACC_MAN;
case TAB_EMOTES -> InterfaceTab.EMOTES;
default -> throw new IllegalStateException("Unexpected value: " + VarcIntValues.valueOf(varcIntValue));
};
This code will fail if you were to check say 0 as zero could refer to a number of enumerations and as this switch case is a check on the enumeration and not the actual value it isn't valid. This is likely an issue in a number of classes Bia revised.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugDenotes that this a bugDenotes that this a bughigh priorityhigh priority, needs to be done soonhigh priority, needs to be done soon