diff --git a/FS25_ADSmartPickup/adOutbound.lua b/FS25_ADSmartPickup/adOutbound.lua index 917fa49..29b502a 100644 --- a/FS25_ADSmartPickup/adOutbound.lua +++ b/FS25_ADSmartPickup/adOutbound.lua @@ -187,19 +187,30 @@ local function findStoreMarker(adEnv, vehicle, product, capacity, sources, liter if product.isPallet then -- "Lager til" med palleskure: første valgte der tager varen, har plads og kan nås local forcedSheds = run ~= nil and ADRunsController ~= nil and ADRunsController.getStoreBuildings ~= nil and ADRunsController.getStoreBuildings(adEnv, run) or {} - local hasForcedShed = false + local hasForcedShed, reasons = false, {} for _, building in ipairs(forcedSheds) do if building.kind == "objectStorage" then hasForcedShed = true local marker = building.unloadMarker or building.loadMarker - if marker ~= nil and ADSources.objectStorageAccepts(building.placeable, product.fillType) - and ADSources.objectStorageFreeSlots(building.placeable) >= 1 and isReachable(marker.id) then - return {wayPointId = marker.id, name = tostring(building.name), free = ADSources.objectStorageFreeSlots(building.placeable)} + local free = ADSources.objectStorageFreeSlots(building.placeable) + local why = nil + if marker == nil then + why = "ingen markør" + elseif not ADSources.objectStorageAccepts(building.placeable, product.fillType) then + why = "palleskuret siger nej til varen" + elseif free < 1 then + why = "fuldt" + elseif not isReachable(marker.id) then + why = "ingen vej til '" .. tostring(marker.name) .. "'" end + if why == nil then + return {wayPointId = marker.id, name = tostring(building.name), free = free} + end + table.insert(reasons, string.format("%s: %s (%d ledige pladser)", tostring(building.name), why, free == math.huge and -1 or free)) end end if hasForcedShed then - warnOnce(adEnv, vehicle, "forcedShed:" .. tostring(product.name), string.format("'%s': %s kan ikke sættes på lager — intet af de valgte palleskure tager varen, har plads og kan nås", tostring(ADRuns.vehicleLabel(vehicle)), tostring(product.name))) + warnOnce(adEnv, vehicle, "forcedShed:" .. tostring(product.name) .. ":" .. table.concat(reasons, ";"), string.format("'%s': %s kan ikke sættes på lager — %s", tostring(ADRuns.vehicleLabel(vehicle)), tostring(product.name), table.concat(reasons, "; "))) return nil end if ADSources.findPalletStore == nil then diff --git a/FS25_ADSmartPickup/modDesc.xml b/FS25_ADSmartPickup/modDesc.xml index dd77440..ae90d0f 100644 --- a/FS25_ADSmartPickup/modDesc.xml +++ b/FS25_ADSmartPickup/modDesc.xml @@ -1,7 +1,7 @@ masterdraco - 1.19.4.0 + 1.19.5.0 <en>AD Smart Pickup</en> diff --git a/docs/BRUGERMANUAL.md b/docs/BRUGERMANUAL.md index b00d208..eea3030 100644 --- a/docs/BRUGERMANUAL.md +++ b/docs/BRUGERMANUAL.md @@ -1,6 +1,6 @@ # AD Smart Pickup — brugermanual -Version 1.19.4 · Farming Simulator 25 · tillæg til AutoDrive +Version 1.19.5 · Farming Simulator 25 · tillæg til AutoDrive *English version: [USER_MANUAL.md](USER_MANUAL.md)* diff --git a/docs/USER_MANUAL.md b/docs/USER_MANUAL.md index b76b6e0..6da7621 100644 --- a/docs/USER_MANUAL.md +++ b/docs/USER_MANUAL.md @@ -1,6 +1,6 @@ # AD Smart Pickup — user manual -Version 1.19.4 · Farming Simulator 25 · add-on for AutoDrive +Version 1.19.5 · Farming Simulator 25 · add-on for AutoDrive *Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*