1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Don't crash when vehicles have 0 friction (#3615)

This commit is contained in:
janisozaur
2016-05-15 16:59:42 +02:00
committed by Ted John
parent 3a6978a9aa
commit b3101dd9b0

View File

@@ -8168,7 +8168,10 @@ int vehicle_update_track_motion(rct_vehicle *vehicle, int *outStation)
}
regs.edx >>= 4;
regs.eax = regs.edx;
regs.eax = regs.eax / totalFriction;
// OpenRCT2: vehicles from different track types can have 0 friction.
if (totalFriction != 0) {
regs.eax = regs.eax / totalFriction;
}
regs.ecx -= regs.eax;
if (!(vehicleEntry->flags_b & VEHICLE_ENTRY_FLAG_B_3)) {