shavit-stats.sp - fix error due to IsPlayerAlive() being called on disconnected client (#1245)
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled

This commit is contained in:
olivia 2025-06-26 07:36:20 -07:00 committed by GitHub
parent ee96ef9f7f
commit 14b9674962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -436,7 +436,7 @@ void SavePlaytime222(int client, float now, Transaction&trans, int style, int iS
if (gI_CurrentStyle[client] == style && gF_PlaytimeStyleStart[client] != 0.0) if (gI_CurrentStyle[client] == style && gF_PlaytimeStyleStart[client] != 0.0)
{ {
diff += now - gF_PlaytimeStyleStart[client]; diff += now - gF_PlaytimeStyleStart[client];
gF_PlaytimeStyleStart[client] = IsPlayerAlive(client) ? now : 0.0; gF_PlaytimeStyleStart[client] = IsClientInGame(client) ? IsPlayerAlive(client) ? now : 0.0 : 0.0;
} }
gF_PlaytimeStyleSum[client][style] = 0.0; gF_PlaytimeStyleSum[client][style] = 0.0;