diff --git a/src/me/yaruma/fightsystem/listener/PlayerQuitListener.java b/src/me/yaruma/fightsystem/listener/PlayerQuitListener.java index d612eaf..00eae77 100644 --- a/src/me/yaruma/fightsystem/listener/PlayerQuitListener.java +++ b/src/me/yaruma/fightsystem/listener/PlayerQuitListener.java @@ -2,6 +2,7 @@ package me.yaruma.fightsystem.listener; import me.yaruma.fightsystem.FightSystem; import me.yaruma.fightsystem.fight.Fight; +import me.yaruma.fightsystem.fight.FightPlayer; import me.yaruma.fightsystem.fight.FightState; import me.yaruma.fightsystem.fight.FightTeam; import org.bukkit.Bukkit; @@ -26,8 +27,11 @@ public class PlayerQuitListener implements Listener { if(fightState == FightState.SETUP){ fightTeam.removePlayer(player); }else if(fightState == FightState.PRE_RUNNING || fightState == FightState.RUNNING){ - fightTeam.getFightPlayer(player).setOut(true); - Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §chat den Kampf verlassen!"); + FightPlayer fightPlayer = fightTeam.getFightPlayer(player); + if(!fightPlayer.isOut()) { + fightTeam.getFightPlayer(player).setOut(true); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §chat den Kampf verlassen!"); + } } } } \ No newline at end of file diff --git a/src/me/yaruma/fightsystem/utils/scoreboard/Scoreboard.java b/src/me/yaruma/fightsystem/utils/scoreboard/Scoreboard.java index 8d80145..94b0d5f 100644 --- a/src/me/yaruma/fightsystem/utils/scoreboard/Scoreboard.java +++ b/src/me/yaruma/fightsystem/utils/scoreboard/Scoreboard.java @@ -39,7 +39,8 @@ public class Scoreboard { objective.setDisplayName(fightTeam.getName()); for (FightPlayer fp : fightTeam.getPlayers()) { - objective.getScore(fightTeam.getPrefix() + fp.getPlayer().getName()).setScore((int) fp.getPlayer().getHealth()); + if(!fp.isOut()) + objective.getScore(fightTeam.getPrefix() + fp.getPlayer().getName()).setScore((int) fp.getPlayer().getHealth()); } index++;