From aa8f6735634f2d54b6441e3259a6818a96b6de55 Mon Sep 17 00:00:00 2001 From: lotodore Date: Wed, 31 Mar 2010 13:00:41 +0000 Subject: [PATCH] If a player rejects an invitation, he is no longer on the invite list. --- src/net/common/serverlobbythread.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index cd9799ba..07c54c8a 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1381,13 +1381,17 @@ ServerLobbyThread::HandleNetPacketRejectGameInvitation(SessionWrapper session, c if (pos != m_gameMap.end() && session.playerData) { ServerGame &game = *pos->second; - if (game.IsPlayerInvited(session.playerData->GetUniqueId())) + unsigned tmpPlayerId = session.playerData->GetUniqueId(); + if (game.IsPlayerInvited(tmpPlayerId)) { + // If he rejects, he is no longer invited. + game.RemovePlayerInvitation(tmpPlayerId); + // Send reject notification. boost::shared_ptr packet(new NetPacket(NetPacket::Alloc)); packet->GetMsg()->present = PokerTHMessage_PR_rejectInvNotifyMessage; RejectInvNotifyMessage_t *netReject = &packet->GetMsg()->choice.rejectInvNotifyMessage; netReject->gameId = reject.gameId; - netReject->playerId = session.playerData->GetUniqueId(); + netReject->playerId = tmpPlayerId; netReject->playerRejectReason = reject.myRejectReason; game.SendToAllPlayers(packet, SessionData::Game);