Closes gh-355. Prevented use of items when still in spawn, including potions (which could be abused by switching between loadouts).

This commit is contained in:
taoneill 2012-01-17 23:36:49 -05:00
parent a86683a98a
commit 1eed5ca366

View File

@ -246,9 +246,10 @@ public class WarPlayerListener extends PlayerListener {
Warzone zone = Warzone.getZoneByPlayerName(player.getName()); Warzone zone = Warzone.getZoneByPlayerName(player.getName());
if (zone != null && zone.getLoadoutSelections().containsKey(player.getName()) if (zone != null && zone.getLoadoutSelections().containsKey(player.getName())
&& zone.getLoadoutSelections().get(player.getName()).isStillInSpawn() && player.getItemInHand().getType() == Material.BOW) { && zone.getLoadoutSelections().get(player.getName()).isStillInSpawn()) {
event.setUseItemInHand(Result.DENY); event.setUseItemInHand(Result.DENY);
War.war.badMsg(player, "Can't shoot from inside the spawn."); War.war.badMsg(player, "Can't use items while still in spawn.");
event.setCancelled(true);
} }
} }
} }