]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_physical_items.qc
Merge branch 'Mario/rifle_arena' into Mario/mutators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_physical_items.qc
index 285dc4a7cbe4d9a886cd2c706503d6bc5a1d3075..74b7db2f0db66fad25135150525f6d762f1dfd61 100644 (file)
@@ -100,14 +100,28 @@ MUTATOR_HOOKFUNCTION(item_spawning)
 
 MUTATOR_DEFINITION(mutator_physical_items)
 {
+       MUTATOR_HOOK(Item_Spawn, item_spawning, CBC_ORDER_ANY);
+
        // check if we have a physics engine
-       if not(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE"))
+       MUTATOR_ONADD
        {
-               dprint("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
-               return FALSE;
+               if not(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE"))
+               {
+                       dprint("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
+                       return -1;
+               }
        }
 
-       MUTATOR_HOOK(Item_Spawn, item_spawning, CBC_ORDER_ANY);
+       MUTATOR_ONROLLBACK_OR_REMOVE
+       {
+               // nothing to roll back
+       }
 
-       return FALSE;
+       MUTATOR_ONREMOVE
+       {
+               print("This cannot be removed at runtime\n");
+               return -1;
+       }
+
+       return 0;
 }