1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix overflow in ride_mode_tweak (#3478)

Fixes #2529: Time overflow when unlocking dodgems' operating limits
Fixes #3424: Max. people on ride overflows when operating limit is unlocked
This commit is contained in:
Patrick de Wit
2016-05-03 15:44:54 +02:00
committed by Ted John
parent 83aa549a9f
commit 60579932ef

View File

@@ -2798,9 +2798,9 @@ static void window_ride_mode_tweak_increase(rct_window *w)
}
uint8 increment = ride->mode == RIDE_MODE_BUMPERCAR ? 10 : 1;
uint8 newValue = ride->operation_option + increment;
if (newValue <= maxValue) {
window_ride_mode_tweak_set(w, newValue);
if (maxValue - increment >= ride->operation_option) {
window_ride_mode_tweak_set(w, ride->operation_option + increment);
}
}