Calculate player numbers in a different way, so that a player number on the server can be converted to a player number on the client.

This commit is contained in:
lotodore
2011-12-22 23:16:58 +00:00
parent fc7be88602
commit ae842b9a2d
3 changed files with 7 additions and 7 deletions
+2 -1
View File
@@ -1651,7 +1651,8 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
if (numPlayers && seatStates && *seatStates) {
for (int i = 0; i < (int)numPlayers; i++) {
NetPlayerState_t *seatState = seatStates[i];
boost::shared_ptr<PlayerInterface> tmpPlayer = client->GetGame()->getPlayerByNumber((i + client->GetOrigGuiPlayerNum()) % numPlayers);
int numberDiff = client->GetStartData().numberOfPlayers - client->GetOrigGuiPlayerNum();
boost::shared_ptr<PlayerInterface> tmpPlayer = client->GetGame()->getPlayerByNumber((i + numberDiff) % client->GetStartData().numberOfPlayers);
if (!tmpPlayer)
throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0);
switch (*seatState)