diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 09bccccac2..3140844ac6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -21,6 +21,7 @@ - Fix: [#9729] Peeps do not take into account height difference when deciding to pathfind to a ride entrance (original bug). - Fix: [#9902] Doors/Portcullis do not check to make sure doors are open causing double opens. - Fix: [#9926] Africa - Oasis park has wrong peep spawn (original bug). +- Fix: [#9955] Resizing map in while pause mode does not work and may result in freezes. - Fix: [#9957] When using 'no money' cheat, guests complain of running out of cash. - Fix: [#9970] Wait for quarter load fails. - Fix: [#10017] Ghost elements influencing ride excitement. diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index f4a30336d3..22af58af05 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1541,24 +1541,34 @@ void map_restore_provisional_elements() void map_remove_out_of_range_elements() { int32_t mapMaxXY = gMapSizeMaxXY; + // Ensure that we can remove elements + bool buildState = gCheatsBuildInPauseMode; + CheatsSet(CheatType::BuildInPauseMode, true); - for (int32_t y = 0; y < (MAXIMUM_MAP_SIZE_TECHNICAL * 32); y += 32) + // Since we might lack cheat permission, check if the cheat has really been turned on. + if (gCheatsBuildInPauseMode) { - for (int32_t x = 0; x < (MAXIMUM_MAP_SIZE_TECHNICAL * 32); x += 32) + for (int32_t y = 0; y < (MAXIMUM_MAP_SIZE_TECHNICAL * 32); y += 32) { - if (x == 0 || y == 0 || x >= mapMaxXY || y >= mapMaxXY) + for (int32_t x = 0; x < (MAXIMUM_MAP_SIZE_TECHNICAL * 32); x += 32) { - // Note this purposely does not use LandSetRightsAction as X Y coordinates are outside of normal range. - auto surfaceElement = map_get_surface_element_at({ x, y }); - if (surfaceElement != nullptr) + if (x == 0 || y == 0 || x >= mapMaxXY || y >= mapMaxXY) { - surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); - update_park_fences_around_tile({ x, y }); + // Note this purposely does not use LandSetRightsAction as X Y coordinates are outside of normal range. + auto surfaceElement = map_get_surface_element_at({ x, y }); + if (surfaceElement != nullptr) + { + surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); + update_park_fences_around_tile({ x, y }); + } + clear_elements_at({ x, y }); } - clear_elements_at({ x, y }); } } } + + //#Reset cheat state + CheatsSet(CheatType::BuildInPauseMode, buildState); } static void map_extend_boundary_surface_extend_tile(const SurfaceElement& sourceTile, SurfaceElement& destTile)