Fix NPE caused by weaponless damage.

This commit is contained in:
Andreas Troelsen 2013-03-21 23:51:06 +01:00
parent 4b970c6fce
commit fd8bfbf1f0

View File

@ -537,7 +537,8 @@ public class ArenaListener
}
// Dirty hack for invincible weapons
p.getInventory().getContents()[p.getInventory().getHeldItemSlot()].setDurability((short) 0);
ItemStack weapon = p.getInventory().getContents()[p.getInventory().getHeldItemSlot()];
if (weapon != null) weapon.setDurability((short) 0);
ArenaPlayerStatistics aps = arena.getArenaPlayer(p).getStats();
aps.add("dmgDone", event.getDamage());