]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix output argument of the mutator hook function PlayerDies and update the variable...
authorterencehill <piuntn@gmail.com>
Wed, 12 Jul 2017 15:52:10 +0000 (17:52 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 12 Jul 2017 15:52:10 +0000 (17:52 +0200)
qcsrc/server/mutators/events.qh
qcsrc/server/player.qc

index f186dd73bdd094c52ee113cfdd17b1f694ef412e..958566ac4a63bf063d3da32186085bd2bf81c20b 100644 (file)
@@ -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);
index faba40f3fc92de55833f334e72590c47ac2d2bac..0ca9cb8491d3084d309b3a5d92be39303c8448f8 100644 (file)
@@ -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)