From: Mario Date: Sat, 5 Aug 2017 00:24:09 +0000 (+1000) Subject: Add a hook to DamageInfo, to allow mutators and mods to add their own explosion effec... X-Git-Tag: xonotic-v0.8.5~2545 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=09fd55b02e6cb038573723622cb74b4b7c86347f;p=xonotic%2Fxonotic-data.pk3dir.git Add a hook to DamageInfo, to allow mutators and mods to add their own explosion effects for new deathtypes --- diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index b3c0b0dfb..f6f8441f3 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -186,3 +186,9 @@ MUTATOR_HOOKABLE(HUD_Contents, EV_NO_ARGS); /** is local */ i(bool, MUTATOR_ARGV_1_bool) \ /**/ 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) \ + /**/ +MUTATOR_HOOKABLE(DamageInfo, EV_DamageInfo); diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index c62bbd6b6..e9298bf02 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -390,6 +390,8 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) } } + MUTATOR_CALLHOOK(DamageInfo, this); + // TODO spawn particle effects and sounds based on w_deathtype if(!DEATH_ISSPECIAL(w_deathtype)) if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit