From: Mario Date: Sat, 1 Apr 2017 13:23:27 +0000 (+1000) Subject: Give client access to the WeaponSound mutator hook X-Git-Tag: xonotic-v0.8.5~2856 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ed4674f277cd50d6372a135ec3166c13808a1d1d;p=xonotic%2Fxonotic-data.pk3dir.git Give client access to the WeaponSound mutator hook --- diff --git a/qcsrc/common/mutators/events.qh b/qcsrc/common/mutators/events.qh index 6b16371a2..107a82030 100644 --- a/qcsrc/common/mutators/events.qh +++ b/qcsrc/common/mutators/events.qh @@ -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) \ diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 8af381f09..d8c76dbf3 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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) diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 89fec0178..8624d26bf 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -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) \