]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clear inventory on ready-restart
authorterencehill <piuntn@gmail.com>
Sun, 29 Nov 2020 16:40:36 +0000 (17:40 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 29 Nov 2020 16:40:36 +0000 (17:40 +0100)
qcsrc/server/command/vote.qc

index e3347980d40a530169766f39150a720c44984a84..7b3818f74f14e8d1030c561e9395e07fd8013a41 100644 (file)
@@ -349,6 +349,18 @@ void reset_map(bool dorespawn)
                shuffleteams();
                shuffleteams_on_reset_map = false;
        }
+
+       FOREACH_CLIENT(IS_PLAYER(it),
+       {
+               entity store = PS(it);
+               if (store)
+               {
+                       for (int j = 0; j < REGISTRY_COUNT(Items); j++)
+                               store.inventory.inv_items[j] = 0;
+                       Inventory_update(store);
+               }
+       });
+
        MUTATOR_CALLHOOK(reset_map_global);
 
        FOREACH_ENTITY_FLOAT_ORDERED(pure_data, false,