]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use target2 for turret death target
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 18 Mar 2017 10:57:19 +0000 (10:57 +0000)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 18 Mar 2017 10:57:19 +0000 (10:57 +0000)
qcsrc/common/turrets/sv_turrets.qc

index ed86ac0c86ffebee57bdf9f0fad36068c52b5e7b..f2f2190231dfcfddb52e4e06bc127a50dc910301 100644 (file)
@@ -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)