From 8ffad7b4189ada9557590d720cfa99f338022219 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Sun, 10 Jul 2022 23:18:26 +0200 Subject: [PATCH] Finally! Tesla turret owner's nade no longer treacherously attacks in non-team gamemodes :) --- qcsrc/common/turrets/turret/tesla.qc | 1 + qcsrc/common/turrets/turret/tesla_weapon.qc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/turrets/turret/tesla.qc b/qcsrc/common/turrets/turret/tesla.qc index 4c27bc9acc..f90672b65d 100644 --- a/qcsrc/common/turrets/turret/tesla.qc +++ b/qcsrc/common/turrets/turret/tesla.qc @@ -62,6 +62,7 @@ bool turret_tesla_firecheck(entity this) 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; } diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qc b/qcsrc/common/turrets/turret/tesla_weapon.qc index b62201eb98..f6102801d1 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qc +++ b/qcsrc/common/turrets/turret/tesla_weapon.qc @@ -73,7 +73,8 @@ entity toast(entity actor, entity from, float range, float damage) if (etarget) { te_csqc_lightningarc(from.origin, etarget.origin); - Damage(etarget, actor, actor, damage, DEATH_TURRET_TESLA.m_id, DMG_NOWEP, etarget.origin, '0 0 0'); + if (etarget != actor.realowner) + Damage(etarget, actor, actor, damage, DEATH_TURRET_TESLA.m_id, DMG_NOWEP, etarget.origin, '0 0 0'); etarget.railgunhit = true; IL_PUSH(g_railgunhit, etarget); } -- 2.39.2