There was some code in here to not change the turn when only one player is
left. Go ahead and don't start the turn when there are no players, and don't change it when there are 1 or LESS. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@171 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -195,13 +195,15 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
|
||||
protected void setFirstTurnHolder ()
|
||||
{
|
||||
int size = _turnGame.getPlayers().length;
|
||||
int firstPick = _turnIdx = RandomUtil.getInt(size);
|
||||
while (!_tgmgr.isActivePlayer(_turnIdx)) {
|
||||
_turnIdx = (_turnIdx + 1) % size;
|
||||
if (_turnIdx == firstPick) {
|
||||
Log.warning("No players eligible for first turn. Choking. " +
|
||||
"[game=" + where() + "].");
|
||||
return;
|
||||
if (size > 0) {
|
||||
int firstPick = _turnIdx = RandomUtil.getInt(size);
|
||||
while (!_tgmgr.isActivePlayer(_turnIdx)) {
|
||||
_turnIdx = (_turnIdx + 1) % size;
|
||||
if (_turnIdx == firstPick) {
|
||||
Log.warning("No players eligible for first turn. Choking. " +
|
||||
"[game=" + where() + "].");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +218,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
|
||||
protected void setNextTurnHolder ()
|
||||
{
|
||||
// stick with the current player if they're the only participant
|
||||
if (_tgmgr.getPlayerCount() == 1) {
|
||||
if (_tgmgr.getPlayerCount() <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user