From 11ae2371ea8bf54bc6458600c1518af0ce3d026d Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 16 Jul 2025 20:42:54 +0200 Subject: [PATCH] Smooth map based on inferred PNG image size, not leftover setting (#24782) --- distribution/changelog.txt | 1 + src/openrct2/world/map_generator/PngTerrainGenerator.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e51cec70ff..d055491884 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Feature: [#24702] [Plugin] Add bindings for missing cheats (forcedParkRating, ignoreRidePrice, makeAllDestructible). - Change: [#24730] Security guards now only walk slowly in crowded areas. - Fix: [#24598] Cannot load .park files that use official legacy footpaths by accident. +- Fix: [#24711] The map soothing function only partially works for custom height map image files. - Fix: [#24773] The new ride window debug authors does not show the correct authors for non legacy ride objects. - Fix: [#24775] The scenery and new ride windows do not filter by file name or identifier correctly for non legacy objects. diff --git a/src/openrct2/world/map_generator/PngTerrainGenerator.cpp b/src/openrct2/world/map_generator/PngTerrainGenerator.cpp index e76d4169b7..02cf9ba182 100644 --- a/src/openrct2/world/map_generator/PngTerrainGenerator.cpp +++ b/src/openrct2/world/map_generator/PngTerrainGenerator.cpp @@ -156,9 +156,9 @@ namespace OpenRCT2::World::MapGenerator HeightMap dest = _heightMapData; // Get technical map size, +2 for the black tiles around the map - auto maxWidth = static_cast(dest.width + 2); - auto maxHeight = static_cast(dest.height + 2); - MapInit({ maxHeight, maxWidth }); + auto mapWidth = static_cast(dest.width + 2); + auto mapHeight = static_cast(dest.height + 2); + MapInit({ mapHeight, mapWidth }); if (settings->smooth_height_map) { @@ -236,7 +236,7 @@ namespace OpenRCT2::World::MapGenerator if (settings->smoothTileEdges) { // Set the tile slopes so that there are no cliffs - smoothMap(settings->mapSize, smoothTileWeak); + smoothMap({ mapWidth, mapHeight }, smoothTileWeak); } } } // namespace OpenRCT2::World::MapGenerator