From: Mario Date: Sat, 5 Aug 2017 00:29:20 +0000 (+1000) Subject: Give the DamageInfo hook a couple of useful parameters X-Git-Tag: xonotic-v0.8.5~2544 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bc78ea10c6fd42401fc52a59f0712d494c8e4a32;p=xonotic%2Fxonotic-data.pk3dir.git Give the DamageInfo hook a couple of useful parameters --- diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index f6f8441f3..24d634ce8 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -190,5 +190,7 @@ MUTATOR_HOOKABLE(ForcePlayermodels_Skip, EV_ForcePlayermodels_Skip); /** Called when damage info is received on the client, useful for playing explosion effects */ #define EV_DamageInfo(i, o) \ /** entity id */ i(entity, MUTATOR_ARGV_0_entity) \ + /** death type */ i(int, MUTATOR_ARGV_1_int) \ + /** hit origin */ i(vector, MUTATOR_ARGV_2_vector) \ /**/ MUTATOR_HOOKABLE(DamageInfo, EV_DamageInfo); diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index e9298bf02..38241c2cc 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -390,7 +390,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) } } - MUTATOR_CALLHOOK(DamageInfo, this); + MUTATOR_CALLHOOK(DamageInfo, this, w_deathtype, w_org); // TODO spawn particle effects and sounds based on w_deathtype if(!DEATH_ISSPECIAL(w_deathtype))