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.
This commit is contained in:
Michael Steenbeek 2024-01-06 14:46:17 +01:00 committed by GitHub
parent ba585f4474
commit adadaafdb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 18 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}