From 83591cf94ef1b0bca0bfe032903c564b964b907f Mon Sep 17 00:00:00 2001 From: mix <167040362+mixiate@users.noreply.github.com> Date: Sat, 22 Nov 2025 23:21:14 +0000 Subject: [PATCH] Fix track construction arrow position when removing track pieces --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9c8a3eb4a2..2706afcab6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.30 (in development) ------------------------------------------------------------------------ +- Fix: [#25524] The track construction arrow does not immediately change position when deleting track pieces. 0.4.29 (2025-11-22) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 99bf94f422..a405657754 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -3261,6 +3261,15 @@ namespace OpenRCT2::Ui::Windows rideIndex, type, direction, liftHillAndAlternativeState, trackPos); WindowRideConstructionUpdateActiveElements(); + gMapSelectArrowPosition = _currentTrackBegin; + Direction arrowDirection = _currentTrackPieceDirection; + // diagonal pieces trigger this + if (arrowDirection >= 4) + arrowDirection += 4; + if (_rideConstructionState == RideConstructionState::Back) + arrowDirection = DirectionReverse(arrowDirection); + gMapSelectArrowDirection = arrowDirection; + if (!(gMapSelectFlags.has(MapSelectFlag::enable))) { // Set height to where the next track piece would begin @@ -3275,20 +3284,11 @@ namespace OpenRCT2::Ui::Windows _rideConstructionNextArrowPulse = curTime + kArrowPulseDuration; _currentTrackSelectionFlags.flip(TrackSelectionFlag::arrow); - trackPos = _currentTrackBegin; - direction = _currentTrackPieceDirection; - type = _currentTrackPieceType; - // diagonal pieces trigger this - if (direction >= 4) - direction += 4; - if (_rideConstructionState == RideConstructionState::Back) - direction = DirectionReverse(direction); - gMapSelectArrowPosition = trackPos; - gMapSelectArrowDirection = direction; + gMapSelectFlags.unset(MapSelectFlag::enableArrow); if (_currentTrackSelectionFlags.has(TrackSelectionFlag::arrow)) gMapSelectFlags.set(MapSelectFlag::enableArrow); - MapInvalidateTileFull(trackPos); + MapInvalidateTileFull(_currentTrackBegin); break; } case RideConstructionState::Selected: