mirror of
https://github.com/taoneill/war.git
synced 2024-12-11 19:36:55 +01:00
Don't allow non-entites to damage players in spawn. Fixes #696
This commit is contained in:
parent
a039e65a8a
commit
215551ec15
@ -254,6 +254,11 @@ public class WarEntityListener implements Listener {
|
|||||||
Player d = (Player) defender;
|
Player d = (Player) defender;
|
||||||
Warzone defenderWarzone = Warzone.getZoneByPlayerName(d.getName());
|
Warzone defenderWarzone = Warzone.getZoneByPlayerName(d.getName());
|
||||||
if (d != null && defenderWarzone != null && event.getDamage() >= d.getHealth()) {
|
if (d != null && defenderWarzone != null && event.getDamage() >= d.getHealth()) {
|
||||||
|
LoadoutSelection defenderLoadoutState = defenderWarzone.getLoadoutSelections().get(d.getName());
|
||||||
|
if (defenderLoadoutState != null && defenderLoadoutState.isStillInSpawn()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
||||||
// don't re-kill a dead person
|
// don't re-kill a dead person
|
||||||
if (d.getHealth() != 0) {
|
if (d.getHealth() != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user