From 60756769ad6419c5f4681f8986d7fc5d2c8fac7f Mon Sep 17 00:00:00 2001 From: Alistair-Afton Date: Wed, 16 Sep 2026 03:17:58 +0200 Subject: [PATCH 1/2] buildingplan: fix roller chain estimate The planner multiplied positive job item quantities by the selected area's volume, so a 9-tile roller asked for 9 chains. Job item quantities are totals for the whole building job: rollers always need exactly 1 chain (plus tiles/4+1 mechanisms via the quantity=-1 sentinel). Only constructions keep the per-tile count, which already has its own path. Fixes #5778 --- docs/changelog.txt | 1 + plugins/lua/buildingplan/planneroverlay.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 8730c9c446..a9fa59386d 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -65,6 +65,7 @@ Template for new versions: - `aquifer`: make ``--skip-top`` and top-relative ``--levels`` take effect for the ``drain``, ``convert``, and ``add`` actions instead of being silently ignored - `autodump`: ``destroy`` no longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held items - `timestream`: deal properly with units who have breathing difficulties +- `buildingplan`: fix roller material estimate asking for one chain per tile instead of one chain total ## Misc Improvements - Added ``Coord2d`` and ``Coord3d`` C++ templates, providing a standard set operations for 2-tuples and 3-tuples of any numeric type diff --git a/plugins/lua/buildingplan/planneroverlay.lua b/plugins/lua/buildingplan/planneroverlay.lua index 4d7180afed..d7163bcd91 100644 --- a/plugins/lua/buildingplan/planneroverlay.lua +++ b/plugins/lua/buildingplan/planneroverlay.lua @@ -208,7 +208,8 @@ local function get_quantity(filter, hollow, bounds) end return quantity * count end - return quantity * get_selected_volume(bounds) + -- job item quantities are totals for the whole building, not per-tile + return quantity end local function cur_building_has_no_area() From 17a4dc5aeee38b10725c1fddeff438699af8fa91 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 17 Sep 2026 09:17:49 -0500 Subject: [PATCH 2/2] reorder changelog.txt --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index a9fa59386d..9c6897abda 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -64,8 +64,8 @@ Template for new versions: - Fix broken weather lookup in ``World::ReadCurrentWeather`` - `aquifer`: make ``--skip-top`` and top-relative ``--levels`` take effect for the ``drain``, ``convert``, and ``add`` actions instead of being silently ignored - `autodump`: ``destroy`` no longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held items -- `timestream`: deal properly with units who have breathing difficulties - `buildingplan`: fix roller material estimate asking for one chain per tile instead of one chain total +- `timestream`: deal properly with units who have breathing difficulties ## Misc Improvements - Added ``Coord2d`` and ``Coord3d`` C++ templates, providing a standard set operations for 2-tuples and 3-tuples of any numeric type