From d3f7660a46453af38c255c01d58d14edf94f1ee2 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 19 Sep 2021 17:18:23 +0200 Subject: [PATCH 1/5] Use min/max water height defines in mapgen --- src/openrct2-ui/windows/MapGen.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 7c18c563f7..dce4f7304b 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -45,7 +45,6 @@ enum { WIDX_TAB_3, WIDX_TAB_4, - TAB_BEGIN, WIDX_MAP_GENERATE = TAB_BEGIN, @@ -822,7 +821,7 @@ static void window_mapgen_simplex_mouseup(rct_window* w, rct_widgetindex widgetI mapgenSettings.mapSize = _mapSize; mapgenSettings.height = _baseHeight; - mapgenSettings.water_level = _waterLevel + 2; + mapgenSettings.water_level = _waterLevel + MINIMUM_WATER_HEIGHT; mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; mapgenSettings.trees = _placeTrees; @@ -883,11 +882,11 @@ static void window_mapgen_simplex_mousedown(rct_window* w, rct_widgetindex widge w->Invalidate(); break; case WIDX_SIMPLEX_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + 2, 54); + _waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT); w->Invalidate(); break; case WIDX_SIMPLEX_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - 2, 0); + _waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0); w->Invalidate(); break; case WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX: @@ -1116,11 +1115,11 @@ static void window_mapgen_heightmap_mousedown(rct_window* w, rct_widgetindex wid widget_invalidate(w, WIDX_HEIGHTMAP_HIGH); break; case WIDX_HEIGHTMAP_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + 2, 54); + _waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT); widget_invalidate(w, WIDX_HEIGHTMAP_WATER_LEVEL); break; case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - 2, 0); + _waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0); widget_invalidate(w, WIDX_HEIGHTMAP_WATER_LEVEL); break; } From 3eaf1d4300abcb00e7ee2b1a61872d845600ecef Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 19 Sep 2021 20:21:24 +0200 Subject: [PATCH 2/5] Add 'new save format' as option for issue area --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 3d1071dee6..ac81d2325d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -36,6 +36,7 @@ body: description: What things had an issue? Check all that apply. multiple: true options: + - New Save Format (NSF) - The bug also exists in RCT2 (vanilla) - This bug is specific to multiplayer - Building the game From a37c8539e7dc7976f51df51fe402bd89cfe71d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 19 Sep 2021 22:38:25 +0200 Subject: [PATCH 3/5] Fix bounds check in Litter::GetName --- src/openrct2/world/Litter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index f2fa1d8108..91f721e620 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -121,7 +121,7 @@ static const rct_string_id litterNames[12] = { rct_string_id Litter::GetName() const { - if (EnumValue(SubType) >= sizeof(litterNames)) + if (EnumValue(SubType) >= std::size(litterNames)) return STR_NONE; return litterNames[EnumValue(SubType)]; } From fddf009afcd6c3e84bc8358e2fdcafb50c2dd4c3 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 21 Sep 2021 04:08:19 +0000 Subject: [PATCH 4/5] Merge Localisation/master into OpenRCT2/develop --- data/language/nl-NL.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 1b022c114a..52f2d18e6a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -3649,7 +3649,12 @@ STR_6449 :{WINDOW_COLOUR_2}Tracks: STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Verkoopt: {BLACK}{STRING} -STR_6453 :Versie-informatie kopiëren +STR_6453 :Versie-informatie kopiëren +STR_6454 :Kan de tekst van de lichtkrant niet veranderen… +STR_6455 :Kan de tekst van dit bord niet veranderen… +STR_6456 :Reuzenscreenshot +STR_6457 :Bug rapporteren op GitHub +STR_6458 :Volgen in het hoofdvenster ############# # Scenarios # From c56810e6a51971b84f60dc4b4a27e15a95f047f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 21 Sep 2021 01:34:58 -0700 Subject: [PATCH 5/5] Fix #15442: Use after free in object manager --- src/openrct2/Editor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index d72df4dd1c..37ec3865ee 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -63,15 +63,18 @@ namespace Editor static void object_list_load() { + auto* context = GetContext(); + + // Unload objects first, the repository is re-populated which owns the objects. + auto& objectManager = context->GetObjectManager(); + objectManager.UnloadAll(); + // Scan objects if necessary - auto context = GetContext(); const auto& localisationService = context->GetLocalisationService(); auto& objectRepository = context->GetObjectRepository(); objectRepository.LoadOrConstruct(localisationService.GetCurrentLanguage()); // Reset loaded objects to just defaults - auto& objectManager = context->GetObjectManager(); - objectManager.UnloadAll(); objectManager.LoadDefaultObjects(); }