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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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)
{