1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix #1519: “See-through rides” doesn’t affect all rides

Rides without track can technically have a vehicle, such as the merry go round or the pirate ship. These vehicles should be hidden of 'see through rides' is enabled.
This commit is contained in:
Rik Smeets
2022-11-05 17:32:22 +01:00
committed by GitHub
parent 643d79b700
commit 3a9900cd14
2 changed files with 19 additions and 0 deletions

View File

@@ -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.

View File

@@ -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<Vehicle>();
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)
{