mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-02 19:56:13 +01:00
Change RTD flags to a strong enum
This commit is contained in:
committed by
GitHub
parent
da8a049b81
commit
47800cddcf
@@ -501,7 +501,7 @@ namespace OpenRCT2::Scripting
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot read 'sequence' property, TrackElement belongs to a maze.";
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ namespace OpenRCT2::Scripting
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot set 'sequence' property, TrackElement belongs to a maze.";
|
||||
}
|
||||
|
||||
@@ -827,7 +827,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot read 'mazeEntry' property, ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (!rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot read 'mazeEntry' property, ride is not a maze.";
|
||||
|
||||
duk_push_int(ctx, el->GetMazeEntry());
|
||||
@@ -857,7 +857,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot set 'mazeEntry' property, ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (!rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot set 'mazeEntry' property, ride is not a maze.";
|
||||
|
||||
el->SetMazeEntry(value.as_uint());
|
||||
@@ -885,7 +885,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot read 'colourScheme' property, ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot read 'colourScheme' property, TrackElement belongs to a maze.";
|
||||
|
||||
duk_push_int(ctx, el->GetColourScheme());
|
||||
@@ -915,7 +915,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot set 'colourScheme', ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot set 'colourScheme' property, TrackElement belongs to a maze.";
|
||||
|
||||
el->SetColourScheme(static_cast<RideColourScheme>(value.as_uint()));
|
||||
@@ -943,7 +943,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot read 'seatRotation' property, ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot read 'seatRotation' property, TrackElement belongs to a maze.";
|
||||
|
||||
duk_push_int(ctx, el->GetSeatRotation());
|
||||
@@ -973,7 +973,7 @@ namespace OpenRCT2::Scripting
|
||||
throw DukException() << "Cannot set 'seatRotation' property, ride is invalid.";
|
||||
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
if (!rtd.HasFlag(RtdFlag::isMaze))
|
||||
throw DukException() << "Cannot set 'seatRotation' property, TrackElement belongs to a maze.";
|
||||
|
||||
el->SetSeatRotation(value.as_uint());
|
||||
|
||||
Reference in New Issue
Block a user