From e60f49d307394cecc0ac99aa39c025fef21fce7a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 11 Dec 2021 16:56:46 +0100 Subject: [PATCH] Properly reset weapon accuracy on player respawn if sv_ready_restart_after_countdown is 1, thanks z411 for pointing out this bug z411: "I think it seems to work as you expect because you are resetting the accuracies before the match starts, but once the players respawn accuracy_resend() which actually sends the stats is called in PutPlayerInServer() when they respawn. So the server is actually resetting the stats before it should, but sends them when they respawn." --- qcsrc/server/command/vote.qc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index e064b717c..09e277116 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -352,8 +352,11 @@ void reset_map(bool dorespawn) shuffleteams_on_reset_map = false; } - FOREACH_CLIENT(IS_PLAYER(it), - { + FOREACH_CLIENT(true, { + if (time <= game_starttime) + accuracy_reset(it); // for spectators too because weapon accuracy is persistent + if (!IS_PLAYER(it)) + continue; if (STAT(FROZEN, it)) Unfreeze(it, false); player_powerups_remove_all(it); @@ -442,10 +445,7 @@ void ReadyRestart_force() game_starttime = time + RESTART_COUNTDOWN; // clear player attributes - FOREACH_CLIENT(true, { - accuracy_reset(it); - if (!IS_PLAYER(it)) - continue; + FOREACH_CLIENT(IS_PLAYER(it), { it.alivetime = 0; CS(it).killcount = 0; float val = PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, 0); -- 2.39.2