From: Mario Date: Wed, 2 Dec 2015 09:52:08 +0000 (+1000) Subject: Make the WeaponModel hook common X-Git-Tag: xonotic-v0.8.2~1584 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ecb96402c38689e2b3abf5a8646aae37e78576c3;p=xonotic%2Fxonotic-data.pk3dir.git Make the WeaponModel hook common --- diff --git a/qcsrc/common/mutators/events.qh b/qcsrc/common/mutators/events.qh index ed57753bd..5cb5b4745 100644 --- a/qcsrc/common/mutators/events.qh +++ b/qcsrc/common/mutators/events.qh @@ -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 diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 2ef2d09b9..a12e8556a 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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 diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index ff9a775cf..75c1872aa 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -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) \