From ed4674f277cd50d6372a135ec3166c13808a1d1d Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 1 Apr 2017 23:23:27 +1000 Subject: [PATCH] Give client access to the WeaponSound mutator hook --- qcsrc/common/mutators/events.qh | 8 ++++++++ qcsrc/common/weapons/all.qc | 8 ++------ qcsrc/server/mutators/events.qh | 8 -------- 3 files changed, 10 insertions(+), 14 deletions(-) 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) \ -- 2.39.2