Check if the snap is valid before getting the client number

This commit is contained in:
smallmodel 2024-10-19 20:39:57 +02:00 committed by GitHub
parent 18abf3854d
commit 40834380cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2064,10 +2064,10 @@ void CG_ParseCGMessage_ver_6()
current_entity_number = iInfo;
commandManager.PlaySound(szTmp, vStart, CHAN_LOCAL, -1, -1, -1, 0);
} else {
} else if (cg.snap) {
current_entity_number = cg.snap->ps.clientNum;
commandManager.PlaySound(szTmp, vStart, CHAN_AUTO, -1, -1, -1, 1);
commandManager.PlaySound(szTmp, vStart, CHAN_LOCAL, -1, -1, -1, 1);
}
current_entity_number = iOldEnt;