]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook to DamageInfo, to allow mutators and mods to add their own explosion effec...
authorMario <mario@smbclan.net>
Sat, 5 Aug 2017 00:24:09 +0000 (10:24 +1000)
committerMario <mario@smbclan.net>
Sat, 5 Aug 2017 00:24:09 +0000 (10:24 +1000)
qcsrc/client/mutators/events.qh
qcsrc/common/effects/qc/damageeffects.qc

index b3c0b0dfbfcf484f292292f8554125c7c154b889..f6f8441f32215b41e106435dc4f8ac05417fa01d 100644 (file)
@@ -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);
index c62bbd6b68cd5b08c5108a9b0c0dd9ac77598693..e9298bf02a661e8cd8562767808b2ac97d8f6a64 100644 (file)
@@ -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