]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Merge branch 'master' into LegendaryGuard/bai_mod
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 9b4ceb48cf69649535feaf9fea7e027a305b3a20..9f53858a66c78dc6455daa908f61b725d5d9ec25 100644 (file)
@@ -3,6 +3,7 @@
 #include <common/command/_mod.qh>
 #include <common/constants.qh>
 #include <common/gamemodes/_mod.qh>
+#include <common/items/inventory.qh>
 #include <common/mapinfo.qh>
 #include <common/net_linked.qh>
 #include <common/notifications/all.qh>
@@ -353,6 +354,20 @@ void reset_map(bool dorespawn)
                shuffleteams();
                shuffleteams_on_reset_map = false;
        }
+
+       FOREACH_CLIENT(IS_PLAYER(it),
+       {
+               if (STAT(FROZEN, it))
+                       Unfreeze(it, false);
+               player_powerups_remove_all(it);
+               entity store = PS(it);
+               if (store)
+               {
+                       Inventory_clear(store.inventory);
+                       Inventory_update(store);
+               }
+       });
+
        MUTATOR_CALLHOOK(reset_map_global);
 
        FOREACH_ENTITY_FLOAT_ORDERED(pure_data, false,
@@ -373,8 +388,6 @@ void reset_map(bool dorespawn)
                if (it.reset2) it.reset2(it);
        });
 
-       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), { Unfreeze(it, false); });
-
        // Moving the player reset code here since the player-reset depends
        // on spawnpoint entities which have to be reset first --blub
        if (dorespawn)
@@ -391,7 +404,6 @@ void reset_map(bool dorespawn)
                                        restart_mapalreadyrestarted to 1 after the countdown ended or when
                                        sv_ready_restart_after_countdown is not used and countdown is still running
                                        */
-                                       // NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
                                        // PlayerScore_Clear(it);
                                        CS(it).killcount = 0;
                                        // stop the player from moving so that he stands still once he gets respawned