Permalink
Browse files

Clear player names iff game not started, instead of iff not host.

This seems more logical, and matches the comment on the next line. Clients no longer
disagree with the host on whether an empty slot has a name, when a player joins and
leaves before the game starts.
  • Loading branch information...
1 parent 1ef4fc6 commit ef685d0b892327b6e8af90da0ade792575925e3d @Cyp Cyp committed May 6, 2012
Showing with 1 addition and 4 deletions.
  1. +1 −1 lib/netplay/netplay.cpp
  2. +0 −3 src/loop.cpp
@@ -280,7 +280,7 @@ void NET_InitPlayer(int i, bool initPosition)
NetPlay.players[i].heartattacktime = 0;
NetPlay.players[i].heartbeat = true; // we always start with a hearbeat
NetPlay.players[i].kick = false;
- if (!NetPlay.isHost)
+ if (ingame.localJoiningInProgress)
{ // only clear name outside of games.
NetPlay.players[i].name[0] = '\0';
}
View
@@ -427,13 +427,10 @@ static void gameStateUpdate()
NetPlay.players[0].allocated, NetPlay.players[1].allocated, NetPlay.players[2].allocated, NetPlay.players[3].allocated, NetPlay.players[4].allocated, NetPlay.players[5].allocated, NetPlay.players[6].allocated, NetPlay.players[7].allocated, NetPlay.players[8].allocated, NetPlay.players[9].allocated,
NetPlay.players[0].position, NetPlay.players[1].position, NetPlay.players[2].position, NetPlay.players[3].position, NetPlay.players[4].position, NetPlay.players[5].position, NetPlay.players[6].position, NetPlay.players[7].position, NetPlay.players[8].position, NetPlay.players[9].position
);
- // TODO: Figure out why the following player names aren't always synchronised.
- uint32_t crc = syncDebugGetCrc();
for (unsigned n = 0; n < MAX_PLAYERS; ++n)
{
syncDebug("Player %d = \"%s\"", n, NetPlay.players[n].name);
}
- syncDebugSetCrc(crc); // Do not dump desynch logs because of NetPlay.players[n].name being different.
// Actually send pending droid orders.
sendQueuedDroidInfo();

0 comments on commit ef685d0

Please sign in to comment.