From: Mario Date: Thu, 12 Nov 2015 06:20:46 +0000 (+1000) Subject: Add a nasty hook to customise impact effects X-Git-Tag: xonotic-v0.8.2~1676 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1c2df0de21db15a1f28a79e62529a0ab547e3239;p=xonotic%2Fxonotic-data.pk3dir.git Add a nasty hook to customise impact effects --- diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 34f75b0ea..baaba14ae 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -130,4 +130,11 @@ vector vbeam_shotorg; vector vbeam_endpos; MUTATOR_HOOKABLE(Particles_VortexBeam, EV_Particles_VortexBeam); +/** Return true to not draw any impact effect */ +#define EV_Weapon_ImpactEffect(i, o) \ + /**/ i(entity, w_hitwep) \ + /**/ +entity w_hitwep; +MUTATOR_HOOKABLE(Weapon_ImpactEffect, EV_Weapon_ImpactEffect); + #endif diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 6cf7c1992..e77f63f69 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -4,6 +4,7 @@ #ifdef CSQC #include "../../deathtypes/all.qh" #include "../../movetypes/movetypes.qh" +#include "../../../client/mutators/events.qh" #include "../../vehicles/all.qh" #include "../../weapons/all.qh" #endif @@ -423,8 +424,10 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) w_backoff = -1 * normalize(force); setorigin(self, w_org + w_backoff * 2); // for sound() calls - if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) { - hitwep.wr_impacteffect(hitwep); + if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) + { + if(!MUTATOR_CALLHOOK(Weapon_ImpactEffect, hitwep)) + hitwep.wr_impacteffect(hitwep); } } }