Call the switch label only is the primary turret is valid

This commit is contained in:
smallmodel 2024-12-08 16:43:58 +01:00 committed by GitHub
parent f0cc34cccf
commit f3f53947bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2130,7 +2130,11 @@ void VehicleTurretGunTandem::SwitchToLinkedTurret()
} else {
pTurret = m_PrimaryTurret;
// Added in 2.30
m_PrimaryTurret->m_SwitchLabel.Execute(this, pTurret, NULL);
if (m_PrimaryTurret) {
// Fixed in OPM
// Check for primary turret before setting the switch label
m_PrimaryTurret->m_SwitchLabel.Execute(this, pTurret, NULL);
}
}
SetActiveTurret(pTurret);