diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index 03304d5c..d6e81fda 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1010,6 +1011,11 @@ ServerGameStateHand::TimerNextGame(const boost::system::error_code &ec, boost::s netEndGame->winnerPlayerId = winnerPlayer->getMyUniqueID(); server->SendToAllPlayers(endGame, SessionData::Game); + // Set winner in database. + boost::shared_ptr tmpPlayer = server->GetPlayerDataByUniqueId(winnerPlayer->getMyUniqueID()); + if (tmpPlayer) + server->GetLobbyThread().GetDatabase().SetGamePlayerPlace(server->GetDBId(), tmpPlayer->GetDBId(), 1); + // Wait for the start of a new game. server->ResetComputerPlayerList(); server->ResetGame();