fix: stald-silo fyldes kun med staldens bedste foder (TMR til køerne) — 1.62.149

This commit is contained in:
2026-10-10 05:03:06 +02:00
parent a22d7870de
commit 3b2a630519
6 changed files with 27 additions and 4 deletions
+4 -1
View File
@@ -776,7 +776,10 @@ function ADSmartPickup.getStableSiloFillTypes(adEnv, stations, farmId)
if husbandry ~= nil and husbandry.rootNode ~= nil then
local okH, hx, _, hz = pcall(getWorldTranslation, husbandry.rootNode)
if okH and math.sqrt((hx - sx) ^ 2 + (hz - sz) ^ 2) <= range then
for fillType in pairs(getHusbandryFoodFillTypes(husbandry) or {}) do result[fillType], any = true, true end
-- serielt foder (køer): kun det bedste (TMR); parallelt foder (høns) æder alle grupper
local foods = getHusbandryFoodFillTypes(husbandry) or {}
if getParallelFoodGroups(husbandry) == nil then foods = ADSupplyPlanner.bestFoodOnly(foods) end
for fillType in pairs(foods) do result[fillType], any = true, true end
if strawIndex ~= nil and husbandry.spec_husbandryStraw ~= nil then result[strawIndex], any = true, true end
end
end