From a60f7de10355c2d1c1bcd0c0ca251deef4cf1158 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 20 Nov 2021 10:25:27 +0000 Subject: [PATCH] Fix #15919: Scenery groups are missing in scenario editor --- distribution/changelog.txt | 1 + src/openrct2/management/Research.cpp | 6 ++++++ src/openrct2/world/Scenery.cpp | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index dadbb538b6..d02f861922 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -8,6 +8,7 @@ - Fix: [#15844] Tile Inspector has inconsistent text colours. - Fix: [#15878] Crash when opening a ride window for a corrupted vehicle. - Fix: [#15908] Crash when track elements have no ride assigned. +- Fix: [#15919] Research status incorrectly considered for scenery when in editor modes. 0.3.5 (2021-11-06) ------------------------------------------------------------------------ diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index d7d9c4944f..1b35dc798e 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -597,6 +597,12 @@ bool scenery_group_is_invented(int32_t sgIndex) return false; } + // All scenery is temporarily invented when in the scenario editor + if (gScreenFlags & SCREEN_FLAGS_EDITOR) + { + return true; + } + if (gCheatsIgnoreResearchStatus) { return true; diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index c706866b6c..f36a1978cf 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -12,6 +12,7 @@ #include "../Cheats.h" #include "../Context.h" #include "../Game.h" +#include "../OpenRCT2.h" #include "../actions/BannerRemoveAction.h" #include "../actions/FootpathAdditionRemoveAction.h" #include "../actions/LargeSceneryRemoveAction.h" @@ -291,6 +292,12 @@ int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry) bool IsSceneryAvailableToBuild(const ScenerySelection& item) { + // All scenery can be built when in the scenario editor + if (gScreenFlags & SCREEN_FLAGS_EDITOR) + { + return true; + } + if (!gCheatsIgnoreResearchStatus) { if (!scenery_is_invented(item))