feat: Sælg fra = altid som standard; tom kilde afvises ikke ved Start (1.62.224)

Brugerønske: udkørsels-flows sælger som standard til enhver pris (0) i stedet for 90 % af
årets top; gemte flows beholder deres valg. sellAtValue holder 0 uden for 50-100-klemmen.
Fanen Udkørsel har Altid som første trin (review). In-game: mælke-flowet fra en tom tank
blev afvist med 'ingen vare valgt' — startkontrollen tæller nu valgte varer for tom kilde.
This commit is contained in:
2026-10-12 00:07:46 +02:00
parent 0fa83cb627
commit aa6b3bef27
10 changed files with 28 additions and 13 deletions
+3 -3
View File
@@ -206,7 +206,7 @@ local function findSellQuote(adEnv, vehicle, product, sellMarkers, sellAtPercent
end)
local unreachableName = nil
for _, quote in ipairs(quotes) do
if quote.percent < (sellAtPercent or 90) then
if quote.percent < (sellAtPercent or ADRuns.DEFAULT_SELL_AT_PERCENT) then
break
end
if homeId == nil or ADWaitPool.hasRouteBothWays(adEnv, vehicle, quote.wayPointId, homeId) then
@@ -441,7 +441,7 @@ function ADOutbound.planCargoTarget(adEnv, run, vehicle, fillType, liters)
if wantsSell(policy) then
local homeId = run.sourceWayPointIds ~= nil and run.sourceWayPointIds[1] or nil
local quote = findSellQuote(adEnv, vehicle, product, ADSources.getSellMarkers(adEnv, farmId), run.sellAtPercent, homeId)
if quote ~= nil and quote.percent >= (run.sellAtPercent or 90) then
if quote ~= nil and quote.percent >= (run.sellAtPercent or ADRuns.DEFAULT_SELL_AT_PERCENT) then
return quote.wayPointId
end
end
@@ -621,7 +621,7 @@ function ADOutbound.choosePickup(adEnv, vehicle)
if trip.kind == "sell" then
for _, product in ipairs(input.products) do
if product.fillType == trip.fillTypes[1] and product.quote ~= nil then
Logging.info(ADOutbound.LOG_PREFIX .. "'%s' pris %s: %.0f kr/1000 l ved %s, årets top %.0f -> %d %% (kræver %d)", tostring(ADRuns.vehicleLabel(vehicle)), product.name, (product.quote.price or 0) * 1000, tostring(product.quote.stationName), (product.quote.top or 0) * 1000, product.quote.percent or 0, run.sellAtPercent or 90)
Logging.info(ADOutbound.LOG_PREFIX .. "'%s' pris %s: %.0f kr/1000 l ved %s, årets top %.0f -> %d %% (kræver %d)", tostring(ADRuns.vehicleLabel(vehicle)), product.name, (product.quote.price or 0) * 1000, tostring(product.quote.stationName), (product.quote.top or 0) * 1000, product.quote.percent or 0, run.sellAtPercent or ADRuns.DEFAULT_SELL_AT_PERCENT)
end
end
end