From: Lyberta Date: Sat, 18 Mar 2017 18:03:56 +0000 (+0300) Subject: Added PlayerDied event. X-Git-Tag: xonotic-v0.8.5~2841^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=574c7cb5fd13cf02254042cf77a9729b7312b2a3;p=xonotic%2Fxonotic-data.pk3dir.git Added PlayerDied event. --- diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 89fec0178..006b726f4 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -69,6 +69,12 @@ MUTATOR_HOOKABLE(ClientDisconnect, EV_ClientDisconnect); /**/ MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies); +/** called after a player died. */ +#define EV_PlayerDied(i, o) \ + /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(PlayerDied, EV_PlayerDied); + /** allows overriding the frag centerprint messages */ #define EV_FragCenterMessage(i, o) \ /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \ diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 9458f1dc0..0c618e109 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -658,6 +658,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0; } )); + MUTATOR_CALLHOOK(PlayerDied, this); } }