Fix #24617: Prevent hired boat with 0 speed causing division by 0

This commit is contained in:
Michał Janiszewski authored and Gymnasiast committed 2025-06-18 23:38:15 +02:00
1 parent cf72933aa5
commit aa519879a7
2 files changed
+5 -1

No files matched your search

+1
View File
@@ -16,6 +16,7 @@
- Fix: [#24576] It is possible to edit open rides in certain circumstances.
- Fix: [#24589] Music tab doesn’t fully render in multiplayer.
- Fix: [#24615] Blank strings in Windows installer.
- Fix: [#24617] ‘Divide by zero’ error when updating boat hire acceleration.
0.4.23 (2025-06-07)
------------------------------------------------------------------------
+4 -1
View File
@@ -3920,7 +3920,10 @@ void Vehicle::UpdateMotionBoatHire()
}
eax -= velocity;
edx = powered_acceleration * 2;
ecx += (eax * edx) / ebx;
if (ebx != 0)
{
ecx += (eax * edx) / ebx;
}
}
acceleration = ecx;
}