From 9b5eaabf97e1271efe942f65d98da2c923322838 Mon Sep 17 00:00:00 2001 From: Michael Bernardi Date: Mon, 31 Jul 2023 23:25:04 +0200 Subject: [PATCH] Fix #20659: Phantom rides when closing construction window while paused --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/MazeConstruction.cpp | 3 --- src/openrct2-ui/windows/RideConstruction.cpp | 4 +--- src/openrct2/network/NetworkBase.cpp | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d507fe8003..6526e564e9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#20543] Crash using show segments height from debug paint options. - Fix: [#20607] Infinite loop when renaming rides with default names longer than 32 bytes. - Fix: [#20642] Track list is sometimes empty due to uninitialized data for the filter string. +- Fix: [#20659] Phantom rides remain when closing construction window while paused. 0.4.5 (2023-05-08) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 1242299d2f..c1041f8297 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -124,12 +124,9 @@ public: { if (currentRide->overall_view.IsNull()) { - int32_t savedPausedState = gGamePaused; - gGamePaused = 0; auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); GameActions::Execute(&gameAction); - gGamePaused = savedPausedState; } else { diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index a70c5e8a75..bad18d22e6 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -294,11 +294,9 @@ public: } else { - int32_t previousPauseState = gGamePaused; - gGamePaused = 0; auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); + gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); GameActions::Execute(&gameAction); - gGamePaused = previousPauseState; } } diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 2db4d44751..84463e885c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -43,7 +43,7 @@ // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "12" +#define NETWORK_STREAM_VERSION "13" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION