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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;