]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give mutators access to the attacker's weapon entity from the Damage_Calculate mutato...
authorMario <mario@smbclan.net>
Thu, 3 May 2018 11:28:33 +0000 (21:28 +1000)
committerMario <mario@smbclan.net>
Thu, 3 May 2018 11:28:33 +0000 (21:28 +1000)
qcsrc/server/g_damage.qc
qcsrc/server/mutators/events.qh

index b36cfc95ac9c4bcf43318ac35d955dc6bb6e90fe..f87bce9e85d56976a6d7b2b9405e24d2bf008c19 100644 (file)
@@ -713,7 +713,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                }
 
                // should this be changed at all? If so, in what way?
-               MUTATOR_CALLHOOK(Damage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force);
+               MUTATOR_CALLHOOK(Damage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force, attacker.(weaponentity));
                damage = M_ARGV(4, float);
                mirrordamage = M_ARGV(5, float);
                force = M_ARGV(6, vector);
index 240f8fc25fac301033bee840e7bfcd1ce8cd0198..d1ba087a2e0ba9e2e2d1743e9d63669560f900f8 100644 (file)
@@ -411,7 +411,8 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor
     /** mirrordamage    */ i(float,  MUTATOR_ARGV_5_float) \
     /** mirrordamage   */ o(float,  MUTATOR_ARGV_5_float) \
     /** force           */ i(vector, MUTATOR_ARGV_6_vector) \
-    /** force                  */ o(vector, MUTATOR_ARGV_6_vector) \
+    /** force           */ o(vector, MUTATOR_ARGV_6_vector) \
+    /** weapon entity  */ i(entity, MUTATOR_ARGV_7_entity) \
     /**/
 MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate);