From f8acb63b156ab0333e838581aac4cca0c09d5996 Mon Sep 17 00:00:00 2001 From: Tachytaenius Date: Thu, 1 Jan 2026 17:24:27 +0000 Subject: [PATCH 1/2] Fix hang when buildings are at the bottom of the world (#40) Tested by changing the exact same line in a v47 install. --- GameBuildings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameBuildings.cpp b/GameBuildings.cpp index f6dab7fa..2bf1d986 100644 --- a/GameBuildings.cpp +++ b/GameBuildings.cpp @@ -101,7 +101,7 @@ void MergeBuildingsToSegment(std::vector* buildings, WorldS z2 = well_building->bucket_z; } - for (uint32_t zz = copiedbuilding->z; zz >= z2; zz--) { + for (uint32_t zz = copiedbuilding->z + 1; zz-- > z2;) { // Avoid underflowing if (copiedbuilding->type == df::enums::building_type::Civzone || copiedbuilding->type == df::enums::building_type::Stockpile || copiedbuilding->type == df::enums::building_type::FarmPlot) { From b719fc0ba6d936c1c039006a9a945b6c04022dfb Mon Sep 17 00:00:00 2001 From: Tachytaenius Date: Thu, 1 Jan 2026 17:27:17 +0000 Subject: [PATCH 2/2] Update changelog --- docs/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 5ef44c6d..68b7b286 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -40,6 +40,7 @@ Template for new versions: ## New Features ## Fixes +- `stonesense`: fixed hang when buildings are at the bottom of the world ## Misc Improvements