diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 0a7ba268d5..1af8e9a0ec 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2085,16 +2085,19 @@ public: } int32_t slope, bank; + bool buildDirectionIsDiagonal = false; if (_rideConstructionState == RideConstructionState::Front || _rideConstructionState == RideConstructionState::Place) { slope = ted.Definition.vangle_start; bank = ted.Definition.bank_start; + buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin); } else if (_rideConstructionState == RideConstructionState::Back) { slope = ted.Definition.vangle_end; bank = ted.Definition.bank_end; + buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end); } else { @@ -2130,7 +2133,8 @@ public: _currentPossibleRideConfigurations[currentPossibleRideConfigurationIndex] = trackType; _currentDisabledSpecialTrackPieces |= (1uLL << currentPossibleRideConfigurationIndex); - if (_currentTrackPieceDirection < 4 && slope == _previousTrackSlopeEnd && bank == _previousTrackBankEnd + if (TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection) == buildDirectionIsDiagonal + && slope == _previousTrackSlopeEnd && bank == _previousTrackBankEnd && (trackType != TrackElemType::TowerBase || currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES))) { @@ -2211,7 +2215,7 @@ public: private: bool TrackPieceDirectionIsDiagonal(const uint8_t direction) { - return direction >= 4; + return direction >= NumOrthogonalDirections; } void Construct()