From 6060de639ef866e4b3388566dbcd6cce09e2b2bc Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 5 Jul 2019 06:25:48 +0200 Subject: [PATCH] Fixing #22 (Dead Spectators can fly to the enemy) --- src/me/yaruma/fightsystem/listener/PlayerMoveListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java b/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java index 161aadd..58c0716 100644 --- a/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java +++ b/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java @@ -59,7 +59,9 @@ public class PlayerMoveListener implements Listener { player.teleport(from); player.sendMessage(FightSystem.PREFIX + "§cDu darfst nicht weiter zu den Kämpfern!"); } - }else if(fightTeam != null && !instance.isEntern() && !fightTeam.getFightPlayer(player).isOut()){ + }else if(fightTeam != null && ( + (!FightSystem.isEntern() && !fightTeam.getFightPlayer(player).isOut()) || + FightSystem.getFightState() == FightState.SPECTATE)){ player.teleport(from); player.sendMessage(FightSystem.PREFIX + "§cDu darfst nicht zu " + Fight.getOpposite(fightTeam).getName() + "§c!"); }