Game stop command: Move unregister of game listener after the gamestate has been changed

This commit is contained in:
libraryaddict 2015-06-09 22:19:03 +12:00
parent 1f08c989b5
commit 2971761a5e

View File

@ -22,8 +22,6 @@ public class StopCommand extends CommandBase<ArcadeManager>
if (Plugin.GetGame() == null)
return;
HandlerList.unregisterAll(Plugin.GetGame());
if (Plugin.GetGame().GetState() == GameState.End || Plugin.GetGame().GetState() == GameState.End)
{
caller.sendMessage("Game is already ending...");
@ -38,6 +36,7 @@ public class StopCommand extends CommandBase<ArcadeManager>
Plugin.GetGame().SetState(GameState.End);
}
HandlerList.unregisterAll(Plugin.GetGame());
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has stopped the game.");
}