]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Put .realowner check before turret_validate_target
authorLegendaryGuard <rootuser999@gmail.com>
Sat, 26 Nov 2022 22:32:49 +0000 (23:32 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Sat, 26 Nov 2022 22:32:49 +0000 (23:32 +0100)
qcsrc/common/turrets/turret/tesla.qc

index f90672b65df3ec6998b6289347e18c9ba868d983..8984ead962951641c91ab77d39e8ae2aed095025 100644 (file)
@@ -57,12 +57,14 @@ bool turret_tesla_firecheck(entity this)
     if((this.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
         do_target_scan = 1;
 
+    if(turret_select_target(this) == this.realowner)
+        return false;
+
     // Old target (if any) invalid?
     if(this.target_validate_time < time)
     if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0)
     {
         this.enemy = NULL;
-        if(turret_select_target(this) == this.realowner) return false;
         this.target_validate_time = time + 0.5;
         do_target_scan = 1;
     }