fix for tob/cox options (#784)

fix for tob/cox options, otherwise it hides cast for NPC Too
This commit is contained in:
Kyleeld
2019-06-28 03:08:40 +01:00
committed by James
parent b2f5f9cd1e
commit 7467fda227

View File

@@ -910,6 +910,20 @@ public class MenuEntrySwapperPlugin extends Plugin
}
}
}
Player[] players = client.getCachedPlayers();
Player player = null;
int identifier = event.getIdentifier();
if (identifier >= 0 && identifier < players.length)
{
player = players[identifier];
}
if (player == null)
{
return;
}
//If the option is already to walk there, or cancel we don't need to swap it with anything
if (pOptionToReplace.equals(CANCEL) || pOptionToReplace.equals(WALK_HERE))
@@ -919,6 +933,7 @@ public class MenuEntrySwapperPlugin extends Plugin
if (((config.getRemoveFreezePlayerCoX() && client.getVar(Varbits.IN_RAID) == 1)
|| (config.getRemoveFreezePlayerToB() && client.getVar(Varbits.THEATRE_OF_BLOOD) == 2))
&& (player.isFriend() || player.isClanMember())
&& CAST_OPTIONS_KEYWORDS.contains(pOptionToReplace))
{
addswap(pOptionToReplace);