Game stop command: Move unregister of game listener after the gamestate has been changed
This commit is contained in:
parent
1f08c989b5
commit
2971761a5e
@ -22,8 +22,6 @@ public class StopCommand extends CommandBase<ArcadeManager>
|
|||||||
if (Plugin.GetGame() == null)
|
if (Plugin.GetGame() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HandlerList.unregisterAll(Plugin.GetGame());
|
|
||||||
|
|
||||||
if (Plugin.GetGame().GetState() == GameState.End || Plugin.GetGame().GetState() == GameState.End)
|
if (Plugin.GetGame().GetState() == GameState.End || Plugin.GetGame().GetState() == GameState.End)
|
||||||
{
|
{
|
||||||
caller.sendMessage("Game is already ending...");
|
caller.sendMessage("Game is already ending...");
|
||||||
@ -38,6 +36,7 @@ public class StopCommand extends CommandBase<ArcadeManager>
|
|||||||
Plugin.GetGame().SetState(GameState.End);
|
Plugin.GetGame().SetState(GameState.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HandlerList.unregisterAll(Plugin.GetGame());
|
||||||
|
|
||||||
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has stopped the game.");
|
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has stopped the game.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user