Now checking if War is laoded in entity_death.

This commit is contained in:
taoneill 2011-12-20 02:34:39 -05:00
parent b057cac73d
commit f7e0b73465

View File

@ -440,16 +440,18 @@ public class WarEntityListener extends EntityListener {
@Override
public void onEntityDeath(EntityDeathEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
if (zone != null) {
event.getDrops().clear();
zone.handleDeath(player);
for (Team team : zone.getTeams()) {
team.teamcast(player.getName() + " died");
}
if (!War.war.isLoaded() || !(event.getEntity() instanceof Player)) {
return;
}
Player player = (Player) event.getEntity();
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
if (zone != null) {
event.getDrops().clear();
zone.handleDeath(player);
for (Team team : zone.getTeams()) {
team.teamcast(player.getName() + " died");
}
}
}