]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/sandbox.qc
Merge remote-tracking branch 'origin/master' into terencehill/hud_code_restructure
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / sandbox.qc
index d7fec13264e5cc70bdfa10e02a21570d0b1d7c50..cf5d82f87ae4ecf141afd7d80dbbb31af2a07e43 100644 (file)
@@ -26,7 +26,7 @@ void sandbox_ObjectFunction_Touch()
        intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
        intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1);
 
-       sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".ogg"), VOL_BASE * intensity, ATTN_NORM);
+       sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTN_NORM);
        pointparticles(particleeffectnum(strcat("impact_", self.material)), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
 }
 
@@ -283,7 +283,7 @@ entity sandbox_ObjectPort_Load(string s, float database)
 {
        // load object properties, and spawn a new object with them
        float n, i;
-       entity e, parent;
+       entity e = world, parent = world;
 
        // separate objects between the ; symbols
        n = tokenizebyseparator(s, "; ");
@@ -294,7 +294,7 @@ entity sandbox_ObjectPort_Load(string s, float database)
        for(i = 0; i < n; ++i)
        {
                float argv_num;
-               string tagname;
+               string tagname = string_null;
                argv_num = 0;
                tokenize_console(port_string[i]);
                e = sandbox_ObjectSpawn(database);
@@ -403,7 +403,7 @@ void sandbox_Database_Load()
                        {
                                // since objects are being loaded for the first time, precache material sounds for each
                                for (i = 1; i <= 5; i++) // 5 sounds in total
-                                       precache_sound(strcat("object/impact_", e.material, "_", ftos(i), ".ogg"));
+                                       precache_sound(strcat("object/impact_", e.material, "_", ftos(i), ".wav"));
                        }
                }
                if(autocvar_g_sandbox_info > 0)
@@ -675,7 +675,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                        if(argv(3))
                                                        {
                                                                for (i = 1; i <= 5; i++) // precache material sounds, 5 in total
-                                                                       precache_sound(strcat("object/impact_", argv(3), "_", ftos(i), ".ogg"));
+                                                                       precache_sound(strcat("object/impact_", argv(3), "_", ftos(i), ".wav"));
                                                                e.material = strzone(argv(3));
                                                        }
                                                        else
@@ -817,6 +817,16 @@ MUTATOR_DEFINITION(sandbox)
                        sandbox_Database_Load();
        }
 
+       MUTATOR_ONROLLBACK_OR_REMOVE
+       {
+               // nothing to roll back
+       }
+
+       MUTATOR_ONREMOVE
+       {
+               // nothing to remove
+       }
+
        return FALSE;
 }