mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #3987: division by zero in vehicle update
Prevent division by zero by checking the value first.
This commit is contained in:
parent
306cf2383c
commit
418eb06e66
|
@ -8476,7 +8476,9 @@ loc_6DC23A:
|
|||
regs.edx = vehicle->powered_acceleration;
|
||||
regs.edx <<= 1;
|
||||
regs.eax *= regs.edx;
|
||||
regs.eax /= regs.ebx;
|
||||
if (regs.ebx != 0) {
|
||||
regs.eax /= regs.ebx;
|
||||
}
|
||||
|
||||
if (vehicleEntry->flags_a & VEHICLE_ENTRY_FLAG_A_15) {
|
||||
regs.eax *= 4;
|
||||
|
|
Loading…
Reference in New Issue