From 27017c0f6268e1e57b186fad63912671e0f23c82 Mon Sep 17 00:00:00 2001 From: masterdraco Date: Wed, 30 Sep 2026 13:26:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(k=C3=A6de):=20opbrugt=20f=C3=A6lles=20kapac?= =?UTF-8?q?itet=20meldes=20som=20flaskehals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FS25_ADSmartPickup/adChainModel.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/FS25_ADSmartPickup/adChainModel.lua b/FS25_ADSmartPickup/adChainModel.lua index 44bdb83..0342000 100644 --- a/FS25_ADSmartPickup/adChainModel.lua +++ b/FS25_ADSmartPickup/adChainModel.lua @@ -106,6 +106,9 @@ function ADChainModel.build(recipes, husbandry, crops) problem("bottleneck", name, rootKey, rest) node.shortPerMonth = rest end + if rest > 1e-9 and #node.producers == 0 then + node.source = nil + end end -- b) stalde if rest > 1e-9 and #node.producers == 0 and herds[name] ~= nil then @@ -125,8 +128,12 @@ function ADChainModel.build(recipes, husbandry, crops) chain.fieldDemand[node.fruit] = (chain.fieldDemand[node.fruit] or 0) + rest rest = 0 end - -- d) ingen kilde (eller rest efter stald) - if rest > 1e-9 and (node.source == nil or node.source == "husbandry") then + -- d) ingen kilde (eller rest efter stald), eller exhausted producers + if rest > 1e-9 and makers ~= nil and #node.producers == 0 and #node.herds == 0 then + node.source = "production" + node.shortPerMonth = rest + problem("bottleneck", name, rootKey, rest) + elseif rest > 1e-9 and (node.source == nil or node.source == "husbandry") then if node.source == nil then node.source = "buy" end node.shortPerMonth = rest problem("buy", name, rootKey, rest)