From: terencehill Date: Sat, 11 Dec 2021 15:56:46 +0000 (+0100) Subject: Properly reset weapon accuracy on player respawn if sv_ready_restart_after_countdown... X-Git-Tag: xonotic-v0.8.5~266 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=e60f49d307394cecc0ac99aa39c025fef21fce7a 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." --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index e064b717cd..09e277116a 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);