Skip to content

Commit a283a7e

Browse files
committed
Fix round not ending when last player on team disconnects
Initial fix attempt did not work, because it was still checking the players team after they had already been set to CS_TEAM_NONE
1 parent 22277f1 commit a283a7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cs2fixes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,9 +953,8 @@ void CS2Fixes::Hook_ClientDisconnect(CPlayerSlot slot, ENetworkDisconnectionReas
953953

954954
if (g_cvarEnableZR.Get())
955955
{
956-
if (player)
957-
ZR_CheckTeamWinConditions(player->m_iTeamNum == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);
958-
else if (!ZR_CheckTeamWinConditions(CS_TEAM_T)) // If we cant get team num, just check both
956+
// Controller team num is not valid post-disconnect, so just check both teams
957+
if (!ZR_CheckTeamWinConditions(CS_TEAM_T))
959958
ZR_CheckTeamWinConditions(CS_TEAM_CT);
960959
}
961960

0 commit comments

Comments
 (0)