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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user