]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the attacker parameter instead of saving globals for button damage (hopefully...
authorMario <mario@smbclan.net>
Wed, 17 May 2017 04:05:32 +0000 (14:05 +1000)
committerMario <mario@smbclan.net>
Wed, 17 May 2017 04:05:32 +0000 (14:05 +1000)
qcsrc/common/triggers/func/button.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh

index c450aaa1f2a7b5f429033b51fb05763c1c1ed733..3c7d47fea4e005962ef0012199a09c0ead36701b 100644 (file)
@@ -91,7 +91,7 @@ void button_damage(entity this, entity inflictor, entity attacker, float damage,
        this.health = this.health - damage;
        if (this.health <= 0)
        {
-               this.enemy = damage_attacker;
+               this.enemy = attacker;
                button_fire(this);
        }
 }
index 7f5ffaf79bd64688327c5e24b1e5cd79dc539642..4f428ab1b84defe579d00ae8f5afe84f36f91fa7 100644 (file)
@@ -618,20 +618,14 @@ void Unfreeze (entity targ)
 
 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
-       float mirrordamage;
-       float mirrorforce;
        float complainteamdamage = 0;
-       entity attacker_save;
-       mirrordamage = 0;
-       mirrorforce = 0;
+       float mirrordamage = 0;
+       float mirrorforce = 0;
 
        if (game_stopped || targ.killcount == FRAGS_SPECTATOR)
                return;
 
-    damage_targ = targ;
-    damage_inflictor = inflictor;
-    damage_attacker = attacker;
-       attacker_save = attacker;
+       entity attacker_save = attacker;
 
        // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
        if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))
index 9a4a8b95d759579f9f3902ffc9165c8246fcf987..e242de4a8a2a43add28f4f008dab92e55f13186b 100644 (file)
@@ -86,11 +86,6 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ);
 
-// these are updated by each Damage call for use in button triggering and such
-entity damage_targ;
-entity damage_inflictor;
-entity damage_attacker;
-
 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 
 float RadiusDamage_running;