diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 3d10c497cb..ed08306002 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -3561,7 +3561,8 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords) _previousTrackPiece = _currentTrackBegin; // search for appropriate z value for ghost, up to max ride height - int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2); + const auto smallZ = z / COORDS_Z_STEP; + int numAttempts = (smallZ <= MAX_TRACK_HEIGHT ? (MAX_TRACK_HEIGHT - smallZ + 1) : 2); if (ride->type == RIDE_TYPE_MAZE) { @@ -3789,7 +3790,8 @@ void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords) } // search for z value to build at, up to max ride height - int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2); + const auto smallZ = z / COORDS_Z_STEP; + int numAttempts = (smallZ <= MAX_TRACK_HEIGHT ? (MAX_TRACK_HEIGHT - smallZ + 1) : 2); if (ride->type == RIDE_TYPE_MAZE) {