]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_new_toys.qc
Merge branch 'master' into terencehill/quickmenu
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_new_toys.qc
index 3e41c42fe022215ae6152a92b0eb7a7a0ff48065..fa7638b515a50a75212ca76c059aeff12cbbf6c8 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 /*
 
 CORE    laser   vortex     lg      rl      cry     gl      elec    hagar   fireb   hook
@@ -69,9 +73,9 @@ roflsound "New toys, new toys!" sound.
 .string new_toys;
 
 float autocvar_g_new_toys_autoreplace;
-#define NT_AUTOREPLACE_NEVER 0
-#define NT_AUTOREPLACE_ALWAYS 1
-#define NT_AUTOREPLACE_RANDOM 2
+const float NT_AUTOREPLACE_NEVER = 0;
+const float NT_AUTOREPLACE_ALWAYS = 1;
+const float NT_AUTOREPLACE_RANDOM = 2;
 
 MUTATOR_HOOKFUNCTION(nt_SetModname)
 {
@@ -83,14 +87,14 @@ float nt_IsNewToy(float w)
 {
        switch(w)
        {
-               case WEP_SEEKER:
-               case WEP_MINE_LAYER:
-               case WEP_HLAC:
-               case WEP_RIFLE:
-               case WEP_SHOCKWAVE:
-                       return TRUE;
+               case WEP_SEEKER.m_id:
+               case WEP_MINE_LAYER.m_id:
+               case WEP_HLAC.m_id:
+               case WEP_RIFLE.m_id:
+               case WEP_SHOCKWAVE.m_id:
+                       return true;
                default:
-                       return FALSE;
+                       return false;
        }
 }
 
@@ -186,7 +190,7 @@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace)
 MUTATOR_HOOKFUNCTION(nt_FilterItem)
 {
        if(nt_IsNewToy(self.weapon))
-               self.item_pickupsound = "weapons/weaponpickup_new_toys.wav";
+               self.item_pickupsound = W_Sound("weaponpickup_new_toys");
        return 0;
 }
 
@@ -202,7 +206,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.wav");
+               precache_sound(W_Sound("weaponpickup_new_toys"));
 
                // mark the guns as ok to use by e.g. impulse 99
                float i;
@@ -221,7 +225,7 @@ MUTATOR_DEFINITION(mutator_new_toys)
 
        MUTATOR_ONREMOVE
        {
-               print("This cannot be removed at runtime\n");
+               LOG_INFO("This cannot be removed at runtime\n");
                return -1;
        }