Update player count decrement logic in PlatformNetworkManagerStub

Refactor the condition for decrementing the player count in CPlatformNetworkManagerStub::DoWork. The previous check was replaced with a while loop to ensure that the player count is only decremented when there are more than one player and the last player's custom data value is zero. This change improves the handling of player connections in the network manager.
This commit is contained in:
MrTheShy 2026-03-10 19:41:12 +01:00
parent 95762b9a3a
commit 5a6e433abe

View file

@ -240,7 +240,7 @@ void CPlatformNetworkManagerStub::DoWork()
qnetPlayer->m_resolvedXuid = INVALID_XUID; qnetPlayer->m_resolvedXuid = INVALID_XUID;
qnetPlayer->m_gamertag[0] = 0; qnetPlayer->m_gamertag[0] = 0;
qnetPlayer->SetCustomDataValue(0); qnetPlayer->SetCustomDataValue(0);
if (IQNet::s_playerCount > 1) while (IQNet::s_playerCount > 1 && IQNet::m_player[IQNet::s_playerCount - 1].GetCustomDataValue() == 0)
IQNet::s_playerCount--; IQNet::s_playerCount--;
} }
// NOTE: Do NOT call PushFreeSmallId here. The old PlayerConnection's // NOTE: Do NOT call PushFreeSmallId here. The old PlayerConnection's