From adadaafdb0ca2b50613275a32439be13cc21c47d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 6 Jan 2024 14:46:17 +0100 Subject: [PATCH] Check station flags instead of hardcoded legacy IDs PR #20483 introduced a check for covered stations, but incorrectly checked the RCT2 IDs. This commit replaces this check with a proper flag check, which will work for any station style, including custom ones. --- src/openrct2/entity/Balloon.cpp | 8 ++------ src/openrct2/ride/Ride.cpp | 12 ------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index 2feb7c5683..69735beccf 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -158,12 +158,8 @@ bool Balloon::Collides() const } else { - // all station platforms besides the plain and invisible ones are covered - auto style = GetRide(trackElement->GetRideIndex())->GetEntranceStyle(); - if (style != RCT12_STATION_STYLE_PLAIN && style != RCT12_STATION_STYLE_INVISIBLE) - { - check_ceiling = true; - } + auto* ride = GetRide(trackElement->GetRideIndex()); + check_ceiling = (ride != nullptr) ? RideHasStationShelter(*ride) : false; } } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index ef6ae35ce9..4342179f78 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5983,15 +5983,3 @@ ResultWithMessage Ride::ChangeStatusCreateVehicles(bool isApplying, const Coords return { true }; } - -uint8_t Ride::GetEntranceStyle() const -{ - if (const auto* stationObject = GetStationObject(); stationObject != nullptr) - { - return GetStationStyleFromIdentifier(stationObject->GetIdentifier()); - } - else - { - return RCT12_STATION_STYLE_PLAIN; - } -}