diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 32405b5ff1..23f21bf694 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -71,6 +71,7 @@ - Fix: [#8647] Marketing campaigns check for entry fees below £1 (original bug). - Fix: [#8653] Crash when peeps attempt to enter a ride with no vehicles. - Fix: [#8720] Desync due to boats colliding with ghost pieces. +- Fix: [#8739] Savegame from original game crashes when cruising through map. - Fix: [#8742] Access violation in vehicle_update_sound_params. - 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. diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 357b2a8cc0..e18f6af50c 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -3075,8 +3075,6 @@ void vehicle_visual_splash_effect( { switch (vehicleEntry->effect_visual) { - case 1: /* nullsub */ - break; case VEHICLE_VISUAL_SPLASH1_EFFECT: vehicle_visual_splash1_effect(session, z, vehicle); break; @@ -3092,9 +3090,6 @@ void vehicle_visual_splash_effect( case VEHICLE_VISUAL_SPLASH5_EFFECT: vehicle_visual_splash5_effect(session, z, vehicle); break; - default: - assert(false); - break; } } @@ -3143,13 +3138,19 @@ void vehicle_paint(paint_session* session, const rct_vehicle* vehicle, int32_t i { return; } - vehicleEntry = &rideEntry->vehicles[vehicle->vehicle_type]; + auto vehicleEntryIndex = vehicle->vehicle_type; if (vehicle->update_flags & VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES) { - vehicleEntry++; + vehicleEntryIndex++; z += 16; } + + if (vehicleEntryIndex >= std::size(rideEntry->vehicles)) + { + return; + } + vehicleEntry = &rideEntry->vehicles[vehicleEntryIndex]; } switch (vehicleEntry->car_visual)