From 88e72fbbf67036a055a28392f843fe80e18be567 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 22 Sep 2005 19:52:58 +0000 Subject: [PATCH] Call endPlayerGame() before we finish the bodyLeft() processing because if the leaving player was the last human player in the room, bodyLeft() will result in a call to placeBecameEmpty() which will shut the game manager down before it has a chance to end the game cleanly as a result of said player leaving. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3708 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/parlor/game/server/GameManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/parlor/game/server/GameManager.java b/src/java/com/threerings/parlor/game/server/GameManager.java index 7b888f335..fcb0d0d36 100644 --- a/src/java/com/threerings/parlor/game/server/GameManager.java +++ b/src/java/com/threerings/parlor/game/server/GameManager.java @@ -570,15 +570,16 @@ public class GameManager extends PlaceManager // documentation inherited protected void bodyLeft (int bodyOid) { - super.bodyLeft(bodyOid); - - // deal with disappearing players + // first resign the player from the game int pidx = IntListUtil.indexOf(_playerOids, bodyOid); - if (pidx != -1 && _gameobj.isInPlay() && - _gameobj.isActivePlayer(pidx)) { + if (pidx != -1 && _gameobj.isInPlay() && _gameobj.isActivePlayer(pidx)) { // end the player's game if they bail on an in-progress game endPlayerGame(pidx); } + + // then complete the bodyLeft() processing which may result in a call + // to placeBecameEmpty() which will shut the game down + super.bodyLeft(bodyOid); } /** @@ -876,7 +877,6 @@ public class GameManager extends PlaceManager return (_gameobj.isInPlay() && _gameobj.getActivePlayerCount() == 1); } - /** * Called when the game is known to be over. This will call some * calldown functions to determine the winner of the game and then