mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
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:
parent
95762b9a3a
commit
5a6e433abe
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue