From f044381e2cf507a139f60dff8582bcbbaabd076c Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 29 Apr 2008 19:00:33 +0000 Subject: [PATCH] Clarify the logic in this method to make it clear that there's no way out that does not result in shutdown() being called. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@589 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/game/server/GameManager.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/parlor/game/server/GameManager.java b/src/java/com/threerings/parlor/game/server/GameManager.java index 911b7362..e6ea16b9 100644 --- a/src/java/com/threerings/parlor/game/server/GameManager.java +++ b/src/java/com/threerings/parlor/game/server/GameManager.java @@ -862,14 +862,17 @@ public class GameManager extends PlaceManager if (_gameobj.state != GameObject.PRE_GAME && _gameobj.state != GameObject.GAME_OVER && _gameobj.state != GameObject.CANCELLED) { _gameobj.setState(GameObject.GAME_OVER); - // and shutdown directly - shutdown(); - - // cancel the game; which will shut us down - } else if (!cancelGame()) { - // or shut down directly if the game is already over - shutdown(); + shutdown(); // and shutdown directly + return; } + + // otherwise, cancel the game; which will shut us down + if (cancelGame()) { + return; + } + + // if we couldn't cancel (because the game was already over) shutdown directly + shutdown(); } /**