1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Fix #12861: Divide-by-0 in UpdateTrackMotionMiniGolf

This fix had already been applied to UpdateTrackMotionPoweredRideAcceleration(), but not here.
This commit is contained in:
Michael Steenbeek
2021-02-09 20:02:15 +01:00
committed by GitHub
parent 0a8cfe75b0
commit 7744458cc8

View File

@@ -9332,7 +9332,8 @@ int32_t Vehicle::UpdateTrackMotionMiniGolf(int32_t* outStation)
}
poweredAcceleration -= velocity;
poweredAcceleration *= powered_acceleration << 1;
poweredAcceleration = poweredAcceleration / quarterForce;
if (quarterForce != 0)
poweredAcceleration /= quarterForce;
if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_WATER_RIDE)
{