If the actor is an american, always call ThinkHoldGun_TurretGun() without checking for enemy

This commit is contained in:
smallmodel 2024-04-28 20:39:54 +02:00
parent 4b05c400b2
commit ac8c18250d
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -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;