]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give client access to the WeaponSound mutator hook
authorMario <mario@smbclan.net>
Sat, 1 Apr 2017 13:23:27 +0000 (23:23 +1000)
committerMario <mario@smbclan.net>
Sat, 1 Apr 2017 13:23:27 +0000 (23:23 +1000)
qcsrc/common/mutators/events.qh
qcsrc/common/weapons/all.qc
qcsrc/server/mutators/events.qh

index 6b16371a2cfa739a97325ad4a8f8c69a04c61657..107a82030c1f99d76d2aa1140d207c3798a0e150 100644 (file)
@@ -96,6 +96,14 @@ MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
     /**/
 MUTATOR_HOOKABLE(PM_Physics, EV_PM_Physics);
 
+/** called when a weapon sound is about to be played, allows custom paths etc. */
+#define EV_WeaponSound(i, o) \
+    /** sound       */ i(string, MUTATOR_ARGV_0_string) \
+    /** output      */ i(string, MUTATOR_ARGV_1_string) \
+    /**/               o(string, MUTATOR_ARGV_1_string) \
+    /**/
+MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
+
 /** called when a weapon model is about to be set, allows custom paths etc. */
 #define EV_WeaponModel(i, o) \
     /** model */  i(string, MUTATOR_ARGV_0_string) \
index 8af381f09119b612bfe445a0963ca910be879af0..d8c76dbf39fbb81b3199407229e0fee7cefc91b8 100644 (file)
@@ -260,12 +260,8 @@ string GetAmmoPicture(.int ammotype)
 string W_Sound(string w_snd)
 {
        string output = strcat("weapons/", w_snd);
-#ifdef SVQC
-               MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
-               return M_ARGV(1, string);
-#else
-               return output;
-#endif
+       MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
+       return M_ARGV(1, string);
 }
 
 string W_Model(string w_mdl)
index 89fec0178c7f01c7d00c22d54f0474a38039d449..8624d26bfa99565a491cc5b40eb1c63e94277cf2 100644 (file)
@@ -86,14 +86,6 @@ MUTATOR_HOOKABLE(FragCenterMessage, EV_FragCenterMessage);
     /**/
 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
 
-/** called when a weapon sound is about to be played, allows custom paths etc. */
-#define EV_WeaponSound(i, o) \
-    /** sound       */ i(string, MUTATOR_ARGV_0_string) \
-    /** output      */ i(string, MUTATOR_ARGV_1_string) \
-    /**/               o(string, MUTATOR_ARGV_1_string) \
-    /**/
-MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
-
 /** called when an item model is about to be set, allows custom paths etc. */
 #define EV_ItemModel(i, o) \
     /** model       */ i(string, MUTATOR_ARGV_0_string) \