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
This commit is contained in:
Michael Bayne
2007-10-08 17:12:46 +00:00
parent 377d0c93f5
commit 2862b32763
@@ -650,10 +650,10 @@ public class GameManager extends PlaceManager
*/ */
public boolean playerIsReady (int pidx) public boolean playerIsReady (int pidx)
{ {
return (!_gameobj.isOccupiedPlayer(pidx) || // unoccupied slot return (!_gameobj.isOccupiedPlayer(pidx) || // unoccupied slot
// player is ready (_playerOids[pidx] != 0 && // player is in the room and...
(_playerOids[pidx] != 0 && !_pendingOids.contains(_playerOids[pidx])) || !_pendingOids.contains(_playerOids[pidx])) || // ...has reported ready
isAI(pidx)); // player is AI 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 // clear out player readiness; everyone must report as ready again to restart the game
Arrays.fill(_playerOids, 0); Arrays.fill(_playerOids, 0);
if (_pendingOids != null) {
_pendingOids.clear();
}
// report the winners and losers if appropriate // report the winners and losers if appropriate
int winnerCount = _gameobj.getWinnerCount(); int winnerCount = _gameobj.getWinnerCount();