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
This commit is contained in:
spacek531 authored and GitHub committed 2022-12-20 15:27:49 +00:00
1 parent 26f447d1c8
commit 952fb9ebe2
1 file changed
+6 -2
+6 -2
View File
@@ -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()