feat(udkørsel): 'Sælg altid når kilden er over X %' (sælger uanset pris, bedste salgssted der kan nås); fix: flydende varer lagres ikke automatisk i en fabriks rist (gyllevogn holdt ved AIO) (v1.33.0.0)

This commit is contained in:
2026-09-26 21:37:20 +02:00
parent 10838779bc
commit 954dd25c51
11 changed files with 74 additions and 6 deletions
+10 -1
View File
@@ -186,6 +186,12 @@ local function findSellQuote(adEnv, vehicle, product, sellMarkers, sellAtPercent
if unreachableName ~= nil then
return nil, unreachableName
end
-- ingen pris over grænsen: det bedste salgssted der kan nås (bruges af "sælg altid over X %")
for _, quote in ipairs(quotes) do
if homeId == nil or ADWaitPool.hasRouteBothWays(adEnv, vehicle, quote.wayPointId, homeId) then
return quote, nil
end
end
return quotes[1], nil
end
@@ -251,7 +257,9 @@ local function findStoreMarker(adEnv, vehicle, product, capacity, sources, liter
return {wayPointId = chosen.id, name = tostring(chosen.name), free = liters}
end
local avoid = ADRunsController ~= nil and ADRunsController.getPickupMarkers ~= nil and ADRunsController.getPickupMarkers() or nil
local marker = ADLoadSwap.findDumpMarker(adEnv, vehicle, product.fillType, liters, nil, isReachable, ADSources.getSourcePlaceables(sources), avoid, true)
-- flydende varer (gylle, digestat, mælk ...) kun i tanke/siloer — ikke automatisk i en fabriks rist
local allowFactories = not (ADLoadSwap.isLiquid ~= nil and ADLoadSwap.isLiquid(product.fillType))
local marker = ADLoadSwap.findDumpMarker(adEnv, vehicle, product.fillType, liters, nil, isReachable, ADSources.getSourcePlaceables(sources), avoid, allowFactories)
if marker == nil then
return nil
end
@@ -356,6 +364,7 @@ function ADOutbound.buildPlanInput(adEnv, run, vehicle)
hasAutoload = hasAutoload,
sellAtPercent = run.sellAtPercent,
storeAbovePercent = run.storeAbovePercent,
sellAbovePercent = run.sellAbovePercent,
collectRound = run.collectRound == true,
products = products,
}