From ac8c18250d89ae46b07d0687e4c69087cd97ee63 Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Sun, 28 Apr 2024 20:39:54 +0200 Subject: [PATCH] If the actor is an american, always call ThinkHoldGun_TurretGun() without checking for enemy --- code/fgame/actor_machinegunner.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/fgame/actor_machinegunner.cpp b/code/fgame/actor_machinegunner.cpp index 07ddaf0e..30e075a1 100644 --- a/code/fgame/actor_machinegunner.cpp +++ b/code/fgame/actor_machinegunner.cpp @@ -89,8 +89,11 @@ void Actor::End_MachineGunner(void) } Unholster(); - if (m_pTurret && m_pTurret->GetOwner() == this) { - m_pTurret->TurretEndUsed(); + if (m_pTurret) { + m_pTurret->m_bHadOwner = true; + if (m_pTurret->GetOwner() == this) { + m_pTurret->TurretEndUsed(); + } } } @@ -207,6 +210,12 @@ void Actor::Think_MachineGunner_TurretGun(void) UpdateEnemyInternal(); + if (m_Team == TEAM_AMERICAN) { + // Added in 2.30 + ThinkHoldGun_TurretGun(); + return; + } + if (m_pTurret->AI_CanTarget(G_GetEntity(0)->centroid)) { ThinkHoldGun_TurretGun(); return;