From: Mario Date: Wed, 17 May 2017 04:05:32 +0000 (+1000) Subject: Use the attacker parameter instead of saving globals for button damage (hopefully... X-Git-Tag: xonotic-v0.8.5~2779 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7c2b858c0a02fea8d375f29ad94b446e6847e7fc;p=xonotic%2Fxonotic-data.pk3dir.git Use the attacker parameter instead of saving globals for button damage (hopefully fixes CTS button shooter maps) --- diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index c450aaa1f..3c7d47fea 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -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); } } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 7f5ffaf79..4f428ab1b 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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)) diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index 9a4a8b95d..e242de4a8 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -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;