Verify that the GameData snap-item exists before using it

This commit is contained in:
Redix 2018-11-11 16:19:20 +01:00
parent 62885e8228
commit 3ed64edfb8

View file

@ -1117,7 +1117,7 @@ void CGameClient::OnNewSnapshot()
continue;
// count not ready players
if((m_Snap.m_pGameData->m_GameStateFlags&(GAMESTATEFLAG_STARTCOUNTDOWN|GAMESTATEFLAG_PAUSED|GAMESTATEFLAG_WARMUP)) &&
if(m_Snap.m_pGameData && (m_Snap.m_pGameData->m_GameStateFlags&(GAMESTATEFLAG_STARTCOUNTDOWN|GAMESTATEFLAG_PAUSED|GAMESTATEFLAG_WARMUP)) &&
m_Snap.m_pGameData->m_GameStateEndTick == 0 && m_aClients[i].m_Team != TEAM_SPECTATORS && !(m_Snap.m_paPlayerInfos[i]->m_PlayerFlags&PLAYERFLAG_READY))
m_Snap.m_NotReadyCount++;