diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9f59065a98..62f6f7b72e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Change: [#17998] Show cursor when using inverted mouse dragging. - Change: [#18230] Make the large flat to steep pieces available on the corkscrew roller coaster without cheats. - Change: [#18381] Convert custom invisible paths to the built-in ones. +- Fix: [#1519] “See-through rides” doesn't affect all rides (original bug). - Fix: [#11679] Facilities clipping issues. - Fix: [#14312] Research ride type message incorrect. - Fix: [#14425] Ride ratings do not skip unallocated ride ids. diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index d3fe9bcfc7..4c0b5efbcd 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -25,6 +25,7 @@ #include "../paint/Paint.h" #include "../profiling/Profiling.h" #include "../ride/Ride.h" +#include "../ride/RideData.h" #include "../ride/TrackDesign.h" #include "../ride/Vehicle.h" #include "../ui/UiContext.h" @@ -1414,12 +1415,29 @@ VisibilityKind GetPaintStructVisibility(const PaintStruct* ps, uint32_t viewFlag switch (ps->entity->Type) { case EntityType::Vehicle: + { if (viewFlags & VIEWPORT_FLAG_HIDE_VEHICLES) { return (viewFlags & VIEWPORT_FLAG_INVISIBLE_VEHICLES) ? VisibilityKind::Hidden : VisibilityKind::Partial; } + // Rides without track can technically have a 'vehicle': + // these should be hidden if 'hide rides' is enabled + if (viewFlags & VIEWPORT_FLAG_HIDE_RIDES) + { + auto vehicle = ps->entity->As(); + if (vehicle == nullptr) + break; + + auto ride = vehicle->GetRide(); + if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) + { + return (viewFlags & VIEWPORT_FLAG_INVISIBLE_RIDES) ? VisibilityKind::Hidden + : VisibilityKind::Partial; + } + } break; + } case EntityType::Guest: if (viewFlags & VIEWPORT_FLAG_HIDE_GUESTS) {