1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Use ride->GetRideTypeDescriptor() in Maze related game actions

This commit is contained in:
frutiemax
2022-05-14 14:19:00 -04:00
committed by GitHub
parent 3acec45f97
commit 9971ca15ad
2 changed files with 6 additions and 2 deletions

View File

@@ -78,7 +78,9 @@ GameActions::Result MazePlaceTrackAction::Query() const
{
heightDifference /= COORDS_Z_PER_TINY_Z;
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
auto* ride = get_ride(_rideIndex);
const auto& rtd = ride->GetRideTypeDescriptor();
if (heightDifference > rtd.Heights.MaxHeight)
{
res.Error = GameActions::Status::TooHigh;
res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;

View File

@@ -89,7 +89,9 @@ GameActions::Result MazeSetTrackAction::Query() const
{
heightDifference /= COORDS_Z_PER_TINY_Z;
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
auto* ride = get_ride(_rideIndex);
const auto& rtd = ride->GetRideTypeDescriptor();
if (heightDifference > rtd.Heights.MaxHeight)
{
res.Error = GameActions::Status::TooHigh;
res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;