From 5945f7110af9abd6a9b6b70e7e3dcbaae1ff311b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 13 Aug 2022 18:43:41 +0200 Subject: [PATCH] Move gGotoStartPlacementMode to windows/RideConstruction.cpp --- src/openrct2-ui/windows/RideConstruction.cpp | 9 +++++---- src/openrct2/ride/RideConstruction.cpp | 1 - src/openrct2/ride/RideConstruction.h | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index dedaa9bca6..8d68a5c982 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -154,6 +154,7 @@ static int32_t _trackPlaceZ; static money32 _trackPlaceCost; static StringId _trackPlaceErrorMessage; static bool _autoRotatingShop; +static bool _gotoStartPlacementMode = false; static constexpr const StringId RideConstructionSeatAngleRotationStrings[] = { STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_135, @@ -2330,7 +2331,7 @@ private: *newCoords = { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }; direction = trackBeginEnd.begin_direction; type = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); - gGotoStartPlacementMode = false; + _gotoStartPlacementMode = false; } else if (track_block_get_next(&inputElement, &outputElement, &newCoords->z, &direction)) { @@ -2338,7 +2339,7 @@ private: newCoords->y = outputElement.y; direction = outputElement.element->GetDirection(); type = outputElement.element->AsTrack()->GetTrackType(); - gGotoStartPlacementMode = false; + _gotoStartPlacementMode = false; } else { @@ -2356,7 +2357,7 @@ private: const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); const rct_preview_track* trackBlock = ted.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; - gGotoStartPlacementMode = true; + _gotoStartPlacementMode = true; // When flat rides are deleted, the window should be reset so the currentRide can be placed again. auto currentRide = get_ride(_currentRideIndex); @@ -4492,7 +4493,7 @@ void window_ride_construction_keyboard_shortcut_demolish_current() static void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piecePos, int32_t type) { - if (gGotoStartPlacementMode) + if (_gotoStartPlacementMode) { _currentTrackBegin.z = floor2(piecePos.z, COORDS_Z_STEP); _rideConstructionState = RideConstructionState::Front; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 779ef95c43..382d70bc76 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -49,7 +49,6 @@ #include "Vehicle.h" using namespace OpenRCT2::TrackMetaData; -bool gGotoStartPlacementMode = false; money16 gTotalRideValueForMoney; diff --git a/src/openrct2/ride/RideConstruction.h b/src/openrct2/ride/RideConstruction.h index 2d805b0a36..307488a101 100644 --- a/src/openrct2/ride/RideConstruction.h +++ b/src/openrct2/ride/RideConstruction.h @@ -35,8 +35,6 @@ enum class RideConstructionState : uint8_t MazeFill }; -extern bool gGotoStartPlacementMode; - extern money32 _currentTrackPrice; extern uint32_t _currentTrackCurve;