menuentryswapper: remove early return (#797)
This commit is contained in:
@@ -906,34 +906,28 @@ 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 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))
|
if (!pOptionToReplace.equals(CANCEL) && !pOptionToReplace.equals(WALK_HERE))
|
||||||
{
|
{
|
||||||
return;
|
Player[] players = client.getCachedPlayers();
|
||||||
}
|
int identifier = event.getIdentifier();
|
||||||
|
|
||||||
if (((config.getRemoveFreezePlayerCoX() && client.getVar(Varbits.IN_RAID) == 1)
|
if (identifier >= 0 && identifier < players.length)
|
||||||
|| (config.getRemoveFreezePlayerToB() && client.getVar(Varbits.THEATRE_OF_BLOOD) == 2))
|
|
||||||
&& (player.isFriend() || player.isClanMember())
|
|
||||||
&& CAST_OPTIONS_KEYWORDS.contains(pOptionToReplace))
|
|
||||||
{
|
{
|
||||||
addswap(pOptionToReplace);
|
Player player = players[identifier];
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (option.equals("talk-to"))
|
if (option.equals("talk-to"))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user