Removed special "party" crap related to starting a game after it's
been created. A party game starts itself without direct user intervention. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3600 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -553,44 +553,12 @@ public abstract class PuzzleManager extends GameManager
|
||||
super.bodyLeft(bodyOid);
|
||||
|
||||
int pidx = IntListUtil.indexOf(_playerOids, bodyOid);
|
||||
if (pidx != -1) {
|
||||
if (_puzobj.isInPlay() && _puzobj.isActivePlayer(pidx)) {
|
||||
// end the player's game if they bail on an in-progress puzzle
|
||||
endPlayerGame(pidx);
|
||||
|
||||
} else if (_puzobj.state == PuzzleObject.AWAITING_PLAYERS &&
|
||||
isPartyGame()) {
|
||||
// handle a player leaving a party game that hasn't yet begun
|
||||
if (removePlayer(getPlayerName(pidx))) {
|
||||
// if they were the creator, choose a new creator
|
||||
if (getPlayerCount() > 0 && _puzobj.creator == pidx) {
|
||||
int npidx = getNextCreator(pidx);
|
||||
_puzobj.setCreator(npidx);
|
||||
// inform occupants of the creator change
|
||||
String message = MessageBundle.tcompose(
|
||||
"m.creator_replaced", getPlayerName(npidx));
|
||||
systemMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pidx != -1 && _puzobj.isInPlay() && _puzobj.isActivePlayer(pidx)) {
|
||||
// end the player's game if they bail on an in-progress puzzle
|
||||
endPlayerGame(pidx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the player index of the next feasible creating player
|
||||
* following the given player index, or <code>-1</code> if there is no
|
||||
* such available player.
|
||||
*/
|
||||
protected int getNextCreator (int pidx)
|
||||
{
|
||||
int size = getPlayerSlots();
|
||||
int npidx = pidx;
|
||||
do {
|
||||
npidx = (npidx + 1) % size;
|
||||
} while (npidx != pidx && !_puzobj.isOccupiedPlayer(npidx));
|
||||
return (npidx == pidx) ? -1 : npidx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player leaves the game in order to determine whether
|
||||
* the game should be ended based on its current state, which will
|
||||
|
||||
Reference in New Issue
Block a user