From 952fb9ebe27dd1dc25e5e3fcd8b6211f35beae5e Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 20 Dec 2022 07:27:49 -0800 Subject: [PATCH] Allow diagonal elements into special elements dropdown (#18879) * add diagonal track elements to special elements dropdown * rename diag to buildDirectionIsDiag * initialize to false * change to gtet sign * fix this thing --- src/openrct2-ui/windows/RideConstruction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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()