1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Eliminate direct ride type check

This commit is contained in:
Michael Steenbeek
2025-05-24 14:52:54 +02:00
committed by GitHub
parent 4873620043
commit 2656f3acc2
5 changed files with 18 additions and 6 deletions

View File

@@ -191,12 +191,12 @@ std::optional<uint8_t> MusicObject::GetOriginalStyleId() const
return _originalStyleId;
}
bool MusicObject::SupportsRideType(ride_type_t rideType)
bool MusicObject::SupportsRideType(ride_type_t rideType, bool onlyAllowIfExplicitlyListed)
{
if (_rideTypes.size() == 0)
{
// Default behaviour for music is to only exclude from merry-go-round
return rideType != RIDE_TYPE_MERRY_GO_ROUND;
// Some rides, like the merry-go-round, need music objects to explicitly list them.
return !onlyAllowIfExplicitlyListed;
}
auto it = std::find(_rideTypes.begin(), _rideTypes.end(), rideType);