]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added PlayerDied event.
authorLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 18:03:56 +0000 (21:03 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 18:03:56 +0000 (21:03 +0300)
qcsrc/server/mutators/events.qh
qcsrc/server/player.qc

index 89fec0178c7f01c7d00c22d54f0474a38039d449..006b726f462ada1ea518516c18f085e8028a64ec 100644 (file)
@@ -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) \
index 9458f1dc065d2ca0fb99685b042a5ea716c5890e..0c618e109d6d41d644aa8a9f04d77357ae5540cf 100644 (file)
@@ -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);
        }
 }