From: Mattia Basaglia Date: Sat, 18 Mar 2017 10:57:19 +0000 (+0000) Subject: Use target2 for turret death target X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b714154329dc2db4f656281198fd71823c68fd5e;p=xonotic%2Fxonotic-data.pk3dir.git Use target2 for turret death target --- diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index ed86ac0c8..f2f219023 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -5,9 +5,6 @@ // Entity damaging the turrent when it reaches 0 health .entity killer; -// Target triggered when the turret is destoryed -.string target_death; - // Generic aiming vector turret_aim_generic(entity this) { @@ -197,16 +194,12 @@ void turret_die(entity this) Turret tur = get_turretinfo(this.m_id); - // Trigger target_death - if ( this.target_death != "" ) + // Trigger target2 on death + if ( this.target2 != "" ) { - for(entity t = NULL; (t = find(t, targetname, this.target_death)); ) - { - if ( t.use ) - { - t.use(t, this.killer, this); - } - } + string oldtarget = this.target; + SUB_UseTargets(this, this.killer, NULL); + this.target = oldtarget; } if(this.damage_flags & TFL_DMG_DEATH_NORESPAWN)