]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make the WeaponModel hook common
authorMario <mario@smbclan.net>
Wed, 2 Dec 2015 09:52:08 +0000 (19:52 +1000)
committerMario <mario@smbclan.net>
Wed, 2 Dec 2015 09:52:08 +0000 (19:52 +1000)
qcsrc/common/mutators/events.qh
qcsrc/common/weapons/all.qc
qcsrc/server/mutators/events.qh

index ed57753bdece4b34514d6bf241518690967d5853..5cb5b4745a5705657053ca6c6ce940072e0c68d6 100644 (file)
@@ -90,4 +90,14 @@ MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
 float pm_maxspeed_mod;
 MUTATOR_HOOKABLE(PM_Physics, EV_PM_Physics);
 
+/** called when a weapon model is about to be set, allows custom paths etc. */
+#define EV_WeaponModel(i, o) \
+    /**/ i(string, weapon_model) \
+    /**/ i(string, weapon_model_output) \
+    /**/ o(string, weapon_model_output) \
+    /**/
+string weapon_model;
+string weapon_model_output;
+MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);
+
 #endif
index 2ef2d09b947d2d9e35a83baf32df90b67ed757e5..a12e8556aafa8a83f37fcfb6a8b948184e39433e 100644 (file)
@@ -267,12 +267,8 @@ string W_Sound(string w_snd)
 string W_Model(string w_mdl)
 {
        string output = strcat("models/weapons/", w_mdl);
-#ifdef SVQC
-               MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
-               return weapon_model_output;
-#else
-               return output;
-#endif
+       MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
+       return weapon_model_output;
 }
 
 #ifndef MENUQC
index ff9a775cf9fd8e0f4faaeb2efaac33f877541a3a..75c1872aa2ccc510330e79772964835b80a7e911 100644 (file)
@@ -73,16 +73,6 @@ string weapon_sound;
 string weapon_sound_output;
 MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
 
-/** called when a weapon model is about to be set, allows custom paths etc. */
-#define EV_WeaponModel(i, o) \
-    /**/ i(string, weapon_model) \
-    /**/ i(string, weapon_model_output) \
-    /**/ o(string, weapon_model_output) \
-    /**/
-string weapon_model;
-string weapon_model_output;
-MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);
-
 /** called when an item model is about to be set, allows custom paths etc. */
 #define EV_ItemModel(i, o) \
     /**/ i(string, item_model) \