1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #8443: Crash when clicking default vehicle for hacked ride

This commit is contained in:
Hielke Morsink
2018-12-15 11:35:36 +01:00
committed by Michael Steenbeek
parent b915bc31f8
commit 04c3d9a97a
2 changed files with 6 additions and 2 deletions

View File

@@ -40,6 +40,7 @@
- Fix: [#8358] Infinite loop when changing vehicle count on stopped ride.
- Fix: [#8433] Crash if master server response is not valid JSON.
- Fix: [#8434] Crash if curl_easy_init fails.
- Fix: [#8443] Crash when selecting the current vehicle for ride that has none available.
- Improved: [#2940] Allow mouse-dragging to set patrol area (Singleplayer only).
- Improved: [#7730] Draw extreme vertical and lateral Gs red in the ride window's graph tab.
- Improved: [#7930] Automatically create folders for custom content.

View File

@@ -2883,8 +2883,11 @@ static void window_ride_vehicle_dropdown(rct_window* w, rct_widgetindex widgetIn
switch (widgetIndex)
{
case WIDX_VEHICLE_TYPE_DROPDOWN:
int32_t newRideType = VehicleDropdownData[dropdownIndex].subtype_id;
ride_set_ride_entry(w->number, newRideType);
if (dropdownIndex >= 0 && static_cast<std::size_t>(dropdownIndex) < VehicleDropdownData.size())
{
int32_t newRideType = VehicleDropdownData[dropdownIndex].subtype_id;
ride_set_ride_entry(w->number, newRideType);
}
break;
}
}