Set place for all players (not only first place) in ranked games. Simple version (all players who leave/lose at the same time get the same place).

This commit is contained in:
lotodore
2010-08-28 14:34:02 +00:00
parent b6723e5ebf
commit 698432279f
3 changed files with 44 additions and 3 deletions
+3 -1
View File
@@ -919,6 +919,9 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr<ServerGame> server)
// Remove disconnected players. This is the one and only place to do this.
server->RemoveDisconnectedPlayers();
// Update rankings of all remaining players.
server->UpdateRankingMap();
// Start next hand - if enough players are left.
list<boost::shared_ptr<PlayerInterface> > playersWithCash = *curGame.getActivePlayerList();
playersWithCash.remove_if(boost::bind(&PlayerInterface::getMyCash, _1) < 1);
@@ -931,7 +934,6 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr<ServerGame> server)
else if (playersWithCash.size() == 1)
{
boost::shared_ptr<PlayerInterface> winnerPlayer = *(playersWithCash.begin());
server->SetPlayerPlace(winnerPlayer->getMyUniqueID(), 1);
server->InternalEndGame();
// View a dialog for a new game - delayed.