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
This commit is contained in:
@@ -862,14 +862,17 @@ public class GameManager extends PlaceManager
|
|||||||
if (_gameobj.state != GameObject.PRE_GAME && _gameobj.state != GameObject.GAME_OVER &&
|
if (_gameobj.state != GameObject.PRE_GAME && _gameobj.state != GameObject.GAME_OVER &&
|
||||||
_gameobj.state != GameObject.CANCELLED) {
|
_gameobj.state != GameObject.CANCELLED) {
|
||||||
_gameobj.setState(GameObject.GAME_OVER);
|
_gameobj.setState(GameObject.GAME_OVER);
|
||||||
// and shutdown directly
|
shutdown(); // and shutdown directly
|
||||||
shutdown();
|
return;
|
||||||
|
|
||||||
// cancel the game; which will shut us down
|
|
||||||
} else if (!cancelGame()) {
|
|
||||||
// or shut down directly if the game is already over
|
|
||||||
shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user