Skip to content

Commit

Permalink
Player muteChat state handling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Nov 9, 2023
1 parent 3b5af17 commit f472916
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/netplay/netplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ void NET_InitPlayers(bool initTeams, bool initSpectator)
for (unsigned i = 0; i < MAX_CONNECTED_PLAYERS; ++i)
{
NET_InitPlayer(i, true, initTeams, initSpectator);
ingame.muteChat[i] = false;
clearPlayerName(i);
NETinitQueue(NETnetQueue(i));
}
Expand Down
1 change: 1 addition & 0 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3240,6 +3240,7 @@ static SwapPlayerIndexesResult recvSwapPlayerIndexes(NETQUEUE queue, const std::
}
}
swapPlayerMultiStatsLocal(playerIndexA, playerIndexB);
std::swap(ingame.muteChat[playerIndexA], ingame.muteChat[playerIndexB]);
multiSyncPlayerSwap(playerIndexA, playerIndexB);

if (playerIndexA == selectedPlayer || playerIndexB == selectedPlayer)
Expand Down
2 changes: 2 additions & 0 deletions src/multijoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ bool MultiPlayerLeave(UDWORD playerIndex)
NETlogEntry("Player leaving game", SYNC_FLAG, playerIndex);
debug(LOG_NET, "** Player %u [%s], has left the game at game time %u.", playerIndex, getPlayerName(playerIndex), gameTime);

ingame.muteChat[playerIndex] = false;

if (wz_command_interface_enabled())
{
std::string playerPublicKeyB64 = base64Encode(getMultiStats(playerIndex).identity.toBytes(EcKey::Public));
Expand Down

0 comments on commit f472916

Please sign in to comment.