]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Merge branch 'z411/srestart' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index b3aa8ca22e9333e3cbbce4256665b69f90c4e12c..aefbc3fd1c502896cd6cfc41c4dc67053bdbe080 100644 (file)
@@ -23,6 +23,7 @@
 #include <server/round_handler.qh>
 #include <server/scores.qh>
 #include <server/teamplay.qh>
+#include <server/weapons/accuracy.qh>
 #include <server/world.qh>
 
 // =============================================
@@ -341,6 +342,8 @@ void reset_map(bool dorespawn)
        {
                if (game_stopped)
                        return;
+
+               PlayerStats_GameReport_Reset_All();
                if (round_handler_IsActive())
                        round_handler_Reset(game_starttime);
        }
@@ -351,8 +354,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);
@@ -436,8 +442,6 @@ void ReadyRestart_force()
        FOREACH_CLIENT(IS_PLAYER(it), {
                it.alivetime = 0;
                CS(it).killcount = 0;
-               float val = PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, 0);
-               PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, -val);
        });
 
        // if we're ending the warmup stage call the corresponding hook