From 8666147c32f523c78f0b6d258b53842042a0e367 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 12 Jul 2017 17:52:10 +0200 Subject: [PATCH] Fix output argument of the mutator hook function PlayerDies and update the variable excess accordingly --- qcsrc/server/mutators/events.qh | 2 +- qcsrc/server/player.qc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index f186dd73b..958566ac4 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -64,7 +64,7 @@ MUTATOR_HOOKABLE(ClientDisconnect, EV_ClientDisconnect); /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \ /** target */ i(entity, MUTATOR_ARGV_2_entity) \ /** deathtype */ i(float, MUTATOR_ARGV_3_float) \ - /** damage */ i(float, MUTATOR_ARGV_4_float) \ + /** damage */ i(float, MUTATOR_ARGV_4_float) \ /** damage */ o(float, MUTATOR_ARGV_4_float) \ /**/ MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies); diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index faba40f3f..0ca9cb849 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -557,7 +557,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1; MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage); - excess = M_ARGV(4, float); + damage = M_ARGV(4, float); + excess = max(0, damage - take - save); //Weapon wep = this.(weaponentity).m_weapon; for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) -- 2.39.2