Don't apply kick fireback on older versions of the game
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s

This commit is contained in:
smallmodel 2025-01-19 14:45:20 +01:00 committed by GitHub
parent 45de1067bd
commit ec6cab28a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1157,6 +1157,14 @@ void VehicleTurretGun::ApplyFireKickback(const Vector& org, float kickback)
return;
}
if (g_target_game <= target_game_e::TG_MOH) {
// Don't apply fire kickback in older version
// this could cause issues as models weren't made for this feature
return;
}
// Added in 2.0
pVehicle = static_cast<Vehicle *>(m_pVehicleOwner.Pointer());
pVehicle->m_fForwardForce += org.x * kickback;
pVehicle->m_fLeftForce += org.y * kickback;