From bb273f5766b68a28edcf90bf47c10a8252931df3 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Sat, 26 Nov 2022 23:32:49 +0100 Subject: [PATCH] Put .realowner check before turret_validate_target --- qcsrc/common/turrets/turret/tesla.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/turrets/turret/tesla.qc b/qcsrc/common/turrets/turret/tesla.qc index f90672b65d..8984ead962 100644 --- a/qcsrc/common/turrets/turret/tesla.qc +++ b/qcsrc/common/turrets/turret/tesla.qc @@ -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; } -- 2.39.2