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:
Ray Greenwell
2007-02-10 03:31:47 +00:00
parent d902b2ed81
commit 71b9ba2827
@@ -195,6 +195,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
protected void setFirstTurnHolder () protected void setFirstTurnHolder ()
{ {
int size = _turnGame.getPlayers().length; int size = _turnGame.getPlayers().length;
if (size > 0) {
int firstPick = _turnIdx = RandomUtil.getInt(size); int firstPick = _turnIdx = RandomUtil.getInt(size);
while (!_tgmgr.isActivePlayer(_turnIdx)) { while (!_tgmgr.isActivePlayer(_turnIdx)) {
_turnIdx = (_turnIdx + 1) % size; _turnIdx = (_turnIdx + 1) % size;
@@ -205,6 +206,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
} }
} }
} }
}
/** /**
* This is called to determine which player will next hold the turn. * This is called to determine which player will next hold the turn.
@@ -216,7 +218,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
protected void setNextTurnHolder () protected void setNextTurnHolder ()
{ {
// stick with the current player if they're the only participant // stick with the current player if they're the only participant
if (_tgmgr.getPlayerCount() == 1) { if (_tgmgr.getPlayerCount() <= 1) {
return; return;
} }