]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_new_toys.qc
Merge remote-tracking branch 'origin/master' into terencehill/hud_code_restructure
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_new_toys.qc
index 5642cf1e54fbacf98e68c5d188ce4718dfde4d2f..89ad13c5380775439b1a186e05ff93c81dba8141 100644 (file)
@@ -43,8 +43,8 @@ In "replace random" mode, Nex will have the default replacement "nex rifle".
 
 This mutator's replacements run BEFORE regular weaponreplace!
 
-       The New Toys guns do NOT get a spawn function, so they can only ever be spawned
-       when this mutator is active.
+The New Toys guns do NOT get a spawn function, so they can only ever be spawned
+when this mutator is active.
 
 Likewise, warmup, give all, give ALL and impulse 99 will not give them unless
 this mutator is active.
@@ -58,11 +58,11 @@ Outside this mutator, they still can be spawned by:
 This mutator performs the default replacements on the DEFAULTS of the
 start weapon selection.
 
-       These weapons appear in the menu's priority list, BUT get a suffix
-       "(Mutator weapon)".
+These weapons appear in the menu's priority list, BUT get a suffix
+"(Mutator weapon)".
 
-       Picking up a "new toys" weapon will not play standard weapon pickup sound, but
-       roflsound "New toys, new toys!" sound.
+Picking up a "new toys" weapon will not play standard weapon pickup sound, but
+roflsound "New toys, new toys!" sound.
 
 */
 
@@ -184,7 +184,7 @@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace)
 MUTATOR_HOOKFUNCTION(nt_FilterItem)
 {
        if(nt_IsNewToy(self.weapon))
-               self.item_pickupsound = "weapons/weaponpickup_new_toys.ogg";
+               self.item_pickupsound = "weapons/weaponpickup_new_toys.wav";
        return 0;
 }
 
@@ -200,7 +200,7 @@ MUTATOR_DEFINITION(mutator_new_toys)
                if(time > 1) // game loads at time 1
                        error("This cannot be added at runtime\n");
 
-               precache_sound("weapons/weaponpickup_new_toys.ogg");
+               precache_sound("weapons/weaponpickup_new_toys.wav");
 
                // mark the guns as ok to use by e.g. impulse 99
                float i;
@@ -208,9 +208,19 @@ MUTATOR_DEFINITION(mutator_new_toys)
                        if(nt_IsNewToy(i))
                                get_weaponinfo(i).spawnflags &~= WEP_FLAG_MUTATORBLOCKED;
        }
+
+       MUTATOR_ONROLLBACK_OR_REMOVE
+       {
+               float i;
+               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+                       if(nt_IsNewToy(i))
+                               get_weaponinfo(i).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+       }
+
        MUTATOR_ONREMOVE
        {
-               error("This cannot be removed at runtime\n");
+               print("This cannot be removed at runtime\n");
+               return -1;
        }
 
        return 0;