Fix #12581: Divide by zero on dodgems on customised vehicles (#12582)

Likely caused by use of the console or a new plugin
This commit is contained in:
Duncan 2020-08-04 00:05:22 +01:00 committed by GitHub
parent 31fc1bd225
commit 4fcdcc3729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -6405,7 +6405,10 @@ int32_t Vehicle::UpdateMotionDodgems()
edx = -edx;
edx >>= 5;
eax += edx;
eax /= mass;
if (mass != 0)
{
eax /= mass;
}
rct_ride_entry* rideEntry = GetRideEntry();
rct_ride_entry_vehicle* vehicleEntry = &rideEntry->vehicles[vehicle_type];