diff --git a/src/net/common/serverrecvstate.cpp b/src/net/common/serverrecvstate.cpp index f1a10e25..08993f21 100644 --- a/src/net/common/serverrecvstate.cpp +++ b/src/net/common/serverrecvstate.cpp @@ -335,6 +335,7 @@ ServerRecvStateInit::InternalProcess(ServerRecvThread &server, SessionWrapper se } else if (packet->ToNetPacketStartEvent()) { + server.ResetComputerPlayerList(); int remainingSlots = server.GetGameData().maxNumberOfPlayers - server.GetCurNumberOfPlayers(); for (int i = 1; i <= remainingSlots; i++) { @@ -581,7 +582,7 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server) int newRound = curGame.getCurrentHand()->getActualRound(); // If round changes, deal cards if needed. - if (newRound != curRound) + if (newRound != curRound && newRound != GAME_STATE_POST_RIVER) { assert(newRound > curRound); // Retrieve active players. If only one player is left, no cards are shown. @@ -651,9 +652,6 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server) } else // hand is over { - // Let the engine find out the winner(s). - curGame.getCurrentHand()->getCurrentBeRo()->run(); - // Retrieve active players. If only one player is left, no cards are shown. std::list > activePlayers = GetActivePlayers(curGame); // if (activePlayers.empty()) TODO throw exception diff --git a/src/net/common/serverrecvthread.cpp b/src/net/common/serverrecvthread.cpp index 714ea4de..0ac87f61 100644 --- a/src/net/common/serverrecvthread.cpp +++ b/src/net/common/serverrecvthread.cpp @@ -485,6 +485,12 @@ ServerRecvThread::AddComputerPlayer(boost::shared_ptr player) m_computerPlayers.push_back(player); } +void +ServerRecvThread::ResetComputerPlayerList() +{ + m_computerPlayers.clear(); +} + size_t ServerRecvThread::GetCurNumberOfPlayers() const { diff --git a/src/net/serverrecvthread.h b/src/net/serverrecvthread.h index 82565237..f093381d 100644 --- a/src/net/serverrecvthread.h +++ b/src/net/serverrecvthread.h @@ -115,6 +115,7 @@ protected: void RemoveDisconnectedPlayers(); void AddComputerPlayer(boost::shared_ptr player); + void ResetComputerPlayerList(); size_t GetCurNumberOfPlayers() const; bool IsPlayerConnected(const std::string &playerName) const;