From 1acb1c4b357472bd76ebf933a7744cde10f761c3 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Sun, 10 Jun 2018 16:34:37 +0100 Subject: [PATCH] Fix #7434: Diagonal ride segments cannot be deleted if they are isolated Mimic vanilla RCT2: - If the isolated track is the last piece on the ride, delete and set the construction mode to a straight piece. Rotate said piece 45 degrees anti-clockwise. - If other track still exists, delete and rotate as above but set the track type to station-platform. - If banked, set track type to the turn that entered the previous orientation. For example, north west banked track would continue with a banked 45 degree turn starting facing west. --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2/windows/_legacy.cpp | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contributors.md b/contributors.md index aa219a0d13..5310de3d21 100644 --- a/contributors.md +++ b/contributors.md @@ -110,6 +110,7 @@ The following people are not part of the development team, but have been contrib * Nathan Zabriskie (NathanZabriskie) * Toby Hinloopen (tobyhinloopen) * Patrick Martinez (martip23) +* Andy Ford (AndyTWF) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 98fdf53d46..e8953a6929 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -32,6 +32,7 @@ - Fix: [#7402] Edges of neigbouring footpaths stay connected after removing a path that's underneath a ride entrance. - Fix: [#7405] Rides can be covered by placing scenery underneath them. - Fix: [#7418] Staff walk off paths with a connection but no adjacent path. +- Fix: [#7434] Diagonal ride segments cannot be deleted if they are isolated. - Fix: [#7436] Only the first 32 vehicles of a train can be painted. - Fix: [#7480] Graphs skip values of 0. - Fix: [#7505] Game crashes when trying to make path over map edge while having clearance checks disabled. diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 201bcf1475..e3be40d319 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1827,7 +1827,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) direction = _currentTrackPieceDirection; type = _currentTrackPieceType; - if (sub_6C683D(&x, &y, &z, direction, type, 0, &tileElement, 0)) { + if (sub_6C683D(&x, &y, &z, direction & 3, type, 0, &tileElement, 0)) { window_ride_construction_update_active_elements(); return; } diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index c0f230d877..142f1584f1 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -513,7 +513,7 @@ void window_ride_construction_mouseup_demolish_next_piece(sint32 x, sint32 y, si _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; _currentTrackSelectionFlags = 0; _rideConstructionArrowPulseTime = 0; - direction = _currentTrackPieceDirection; + _currentTrackPieceDirection = direction & 3; sint32 slope = _currentTrackCurve; sint32 slopeEnd = _previousTrackSlopeEnd; sint32 b2 = _currentTrackSlopeEnd; @@ -525,7 +525,7 @@ void window_ride_construction_mouseup_demolish_next_piece(sint32 x, sint32 y, si window_ride_construction_update_active_elements(); if (!ride_try_get_origin_element(_currentRideIndex, NULL)) { ride_initialise_construction_window(_currentRideIndex); - _currentTrackPieceDirection = direction; + _currentTrackPieceDirection = direction & 3; if (!(slope & 0x100)) { _currentTrackCurve = slope; _previousTrackSlopeEnd = slopeEnd;