From: terencehill Date: Wed, 12 Jul 2017 15:52:10 +0000 (+0200) Subject: Fix output argument of the mutator hook function PlayerDies and update the variable... X-Git-Tag: xonotic-v0.8.5~2647 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8666147c32f523c78f0b6d258b53842042a0e367;p=xonotic%2Fxonotic-data.pk3dir.git Fix output argument of the mutator hook function PlayerDies and update the variable excess accordingly --- 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)