Handle deaths after they have been counted and rewarded.

This prevents a problem where players could be rewarded after the game ends
This commit is contained in:
cmastudios 2013-09-10 18:11:21 -05:00
parent dbac21aa44
commit 12b5f8350f

View File

@ -171,15 +171,6 @@ public class WarEntityListener implements Listener {
team.teamcast(killMessage);
}
}
// this is just an idea for further discussion
// if (defenderWarzone.getKillCount(d.getName()) >= 5) {
// defenderTeam.addPoint();
// for (Team team : defenderWarzone.getTeams()) {
// team.teamcast(defenderTeam.getKind().getColor() + d.getName() + ChatColor.WHITE + " killed " + attackerTeam.getKind().getColor() + a.getName()
// + ChatColor.WHITE + " and scored an extra point for their team.");
// }
// }
defenderWarzone.handleDeath(d);
if (attacker.getEntityId() != defender.getEntityId()) {
defenderWarzone.addKillCount(a.getName(), 1);
defenderWarzone.addKillDeathRecord(a, 1, 0);
@ -191,7 +182,7 @@ public class WarEntityListener implements Listener {
War.war.getKillstreakReward().rewardPlayer(a, defenderWarzone.getKillCount(a.getName()));
}
}
defenderWarzone.handleDeath(d);
if (!defenderWarzone.getWarzoneConfig().getBoolean(WarzoneConfig.REALDEATHS)) {
// fast respawn, don't really die
event.setCancelled(true);