From 574c7cb5fd13cf02254042cf77a9729b7312b2a3 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sat, 18 Mar 2017 21:03:56 +0300 Subject: [PATCH] Added PlayerDied event. --- qcsrc/server/mutators/events.qh | 6 ++++++ qcsrc/server/player.qc | 1 + 2 files changed, 7 insertions(+) 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); } } -- 2.39.2