From 2862b32763e9a0e746c6ad157a11f57669f96e00 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 8 Oct 2007 17:12:46 +0000 Subject: [PATCH] Comment fiddling; clear out _pendingOids at the end of the game to avoid potential weirdness if someone got into the room but never reported ready. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@443 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../threerings/parlor/game/server/GameManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/parlor/game/server/GameManager.java b/src/java/com/threerings/parlor/game/server/GameManager.java index 8bad5106..bfd4002b 100644 --- a/src/java/com/threerings/parlor/game/server/GameManager.java +++ b/src/java/com/threerings/parlor/game/server/GameManager.java @@ -650,10 +650,10 @@ public class GameManager extends PlaceManager */ public boolean playerIsReady (int pidx) { - return (!_gameobj.isOccupiedPlayer(pidx) || // unoccupied slot - // player is ready - (_playerOids[pidx] != 0 && !_pendingOids.contains(_playerOids[pidx])) || - isAI(pidx)); // player is AI + return (!_gameobj.isOccupiedPlayer(pidx) || // unoccupied slot + (_playerOids[pidx] != 0 && // player is in the room and... + !_pendingOids.contains(_playerOids[pidx])) || // ...has reported ready + isAI(pidx)); // player is AI } /** @@ -1154,6 +1154,9 @@ public class GameManager extends PlaceManager // clear out player readiness; everyone must report as ready again to restart the game Arrays.fill(_playerOids, 0); + if (_pendingOids != null) { + _pendingOids.clear(); + } // report the winners and losers if appropriate int winnerCount = _gameobj.getWinnerCount();