feat: indstillinger waitHomeMinutes + troughRefillPercent (v1.62.143)
This commit is contained in:
@@ -786,11 +786,17 @@ local getTargetLevelAndCapacity = ADSmartPickup.getStationLevelAndCapacity
|
||||
-- Niveau + kapacitet pr. ingrediens i aflæsningsmålets lager; demand giver forbrug/min.
|
||||
local function getTargetNeeds(station, ingredients, farmId, demand)
|
||||
local needs = {}
|
||||
-- trug-tærskel pr. stald (ADSettings "troughRefillPercent"): kør først når truget er under tærsklen
|
||||
local placeable = station ~= nil and station.owningPlaceable or nil
|
||||
local buildingId = placeable ~= nil and ADBuildings ~= nil and ADBuildings.getId ~= nil and ADBuildings.getId(placeable) or nil
|
||||
local threshold = ADSettings ~= nil and ADSettings.get("troughRefillPercent", buildingId) or 100
|
||||
for _, fillType in ipairs(ingredients) do
|
||||
local level, capacity = getTargetLevelAndCapacity(station, fillType, farmId)
|
||||
if level ~= nil then
|
||||
local troughScore, priority, troughCapacity = getFoodPriority(station, fillType)
|
||||
table.insert(needs, {fillType = fillType, level = level, capacity = capacity, litersPerMinute = demand[fillType], scoreOverride = troughScore, priority = priority, troughCapacity = troughCapacity})
|
||||
if troughScore == nil or ADSupplyPlanner.troughNeedsRefill(troughScore, threshold) then
|
||||
table.insert(needs, {fillType = fillType, level = level, capacity = capacity, litersPerMinute = demand[fillType], scoreOverride = troughScore, priority = priority, troughCapacity = troughCapacity})
|
||||
end
|
||||
end
|
||||
end
|
||||
return needs
|
||||
|
||||
Reference in New Issue
Block a user