diff --git a/FS25_ADSmartPickup/adBuildings.lua b/FS25_ADSmartPickup/adBuildings.lua
index 85b2b85..4832954 100644
--- a/FS25_ADSmartPickup/adBuildings.lua
+++ b/FS25_ADSmartPickup/adBuildings.lua
@@ -203,6 +203,13 @@ local function isSellPlaceable(placeable, unloadStations)
return false
end
+local function hasOwnLoadingStation(placeable, loadStations)
+ for _, station in pairs(loadStations) do
+ if station.owningPlaceable == placeable then return true end
+ end
+ return false
+end
+
local function build(adEnv, farmId)
local placeables = g_currentMission ~= nil and g_currentMission.placeableSystem ~= nil and g_currentMission.placeableSystem.placeables or {}
local storage = g_currentMission ~= nil and g_currentMission.storageSystem or nil
@@ -213,6 +220,9 @@ local function build(adEnv, farmId)
local kind = getKind(placeable)
local isSell = kind == nil and isSellPlaceable(placeable, unloadStations)
if isSell then kind = "sell" end
+ -- generelt lager: gårdens bygning med egen læssestation uden silo/fabrik/stald-spec
+ -- (fx Pumps&Hoses' separatorhal der udleverer digestat)
+ if kind == nil and hasOwnLoadingStation(placeable, loadStations) then kind = "storage" end
if kind ~= nil and (kind == "sell" or isOwnedBy(placeable, farmId)) then
local id = ADBuildings.getId(placeable)
if id ~= nil then
diff --git a/FS25_ADSmartPickup/adSources.lua b/FS25_ADSmartPickup/adSources.lua
index 230226c..8691402 100644
--- a/FS25_ADSmartPickup/adSources.lua
+++ b/FS25_ADSmartPickup/adSources.lua
@@ -141,6 +141,10 @@ function ADSources.identify(adEnv, wayPointId, farmId)
if placeable ~= nil and placeable.getHusbandryFillLevel ~= nil then
return {kind = "husbandry", placeable = placeable, station = station, wayPointId = wayPointId, name = getPlaceableName(placeable, markerName)}
end
+ -- generelt lager: anden bygning med læssestation (fx separatorhal med digestat); varer fra stationen
+ if placeable ~= nil and placeable.spec_objectStorage == nil then
+ return {kind = "storage", placeable = placeable, station = station, wayPointId = wayPointId, name = getPlaceableName(placeable, markerName)}
+ end
-- Det strenge opslag (trigger bag næsen) passer til silorækker; en mælketank eller fabrik ligger
-- ofte ved siden af markøren. Løst opslag inden for 40 m — men aldrig for siloer.
if placeable == nil and ADSmartPickup.getLoadStationNearWayPointId ~= nil then
@@ -402,6 +406,30 @@ local function getHusbandryProducts(adEnv, source)
return products
end
+-- Generelt lager: det læssestationen har af de varer den udleverer (supportedFillTypes/triggeres fillTypes;
+-- ukendt = alt med niveau). Kapacitet = stationens samlede.
+local function getStationProducts(source)
+ local station = source.station
+ if station == nil or station.getAllFillLevels == nil then
+ return {}
+ end
+ local farmId = g_currentMission ~= nil and g_currentMission.getFarmId ~= nil and g_currentMission:getFarmId() or 1
+ local ok, levels, capacity = pcall(station.getAllFillLevels, station, farmId)
+ if not ok or type(levels) ~= "table" then
+ return {}
+ end
+ local supported = station.supportedFillTypes
+ local products = {}
+ for fillType, level in pairs(levels) do
+ local isSupported = supported == nil or next(supported) == nil or supported[fillType] == true
+ if isSupported and (level or 0) > 0 then
+ table.insert(products, newProduct(fillType, level, level, math.max(tonumber(capacity) or 0, level), false))
+ end
+ end
+ table.sort(products, function(a, b) return a.fillType < b.fillType end)
+ return products
+end
+
-- Varer ved kilden med tilgængelig mængde: { {fillType, name, title, available, level, capacity, isPallet} }.
function ADSources.getProducts(adEnv, source, farmId)
if source.kind == "factory" then
@@ -410,6 +438,8 @@ function ADSources.getProducts(adEnv, source, farmId)
return getSiloProducts(source)
elseif source.kind == "husbandry" then
return getHusbandryProducts(adEnv, source)
+ elseif source.kind == "storage" then
+ return getStationProducts(source)
elseif source.kind == "objectStorage" then
return getObjectStorageProducts(source)
end
diff --git a/FS25_ADSmartPickup/l10n/l10n_da.xml b/FS25_ADSmartPickup/l10n/l10n_da.xml
index 637fcb7..958fb2f 100644
--- a/FS25_ADSmartPickup/l10n/l10n_da.xml
+++ b/FS25_ADSmartPickup/l10n/l10n_da.xml
@@ -101,6 +101,7 @@
+
diff --git a/FS25_ADSmartPickup/l10n/l10n_en.xml b/FS25_ADSmartPickup/l10n/l10n_en.xml
index fa93ab3..fc254f1 100644
--- a/FS25_ADSmartPickup/l10n/l10n_en.xml
+++ b/FS25_ADSmartPickup/l10n/l10n_en.xml
@@ -101,6 +101,7 @@
+
diff --git a/FS25_ADSmartPickup/modDesc.xml b/FS25_ADSmartPickup/modDesc.xml
index cbb07b3..7777843 100644
--- a/FS25_ADSmartPickup/modDesc.xml
+++ b/FS25_ADSmartPickup/modDesc.xml
@@ -1,7 +1,7 @@
masterdraco
- 1.18.3.0
+ 1.18.4.0
AD Smart Pickup
diff --git a/docs/BRUGERMANUAL.md b/docs/BRUGERMANUAL.md
index 37a478d..0cd0af7 100644
--- a/docs/BRUGERMANUAL.md
+++ b/docs/BRUGERMANUAL.md
@@ -1,6 +1,6 @@
# AD Smart Pickup — brugermanual
-Version 1.18.3 · Farming Simulator 25 · tillæg til AutoDrive
+Version 1.18.4 · Farming Simulator 25 · tillæg til AutoDrive
*English version: [USER_MANUAL.md](USER_MANUAL.md)*
@@ -275,6 +275,7 @@ Under **Fra** kan du vælge:
| **Silo** | Siloens indhold |
| **Stald** | Mælk, gylle og gødning fra staldens læssepunkter, inklusive tilknyttede udvidelsestanke som Milk Tank Extension |
| **Objektlager** | Paller og baller. De tages ud én ad gangen |
+| **Lager** | Andre bygninger med en læssestation, fx Pumps & Hoses' separatorhal med digestat. Varerne læses fra læssestationen |
**Kilder med fælles lager:** nogle lagre er udvidelser, der deler beholdning med alle inden for en
vis afstand, fx mælketanke i en række. Læsser man ved én, tømmes de alle. Moden opdager det selv og
diff --git a/docs/USER_MANUAL.md b/docs/USER_MANUAL.md
index a8b650b..d59a17f 100644
--- a/docs/USER_MANUAL.md
+++ b/docs/USER_MANUAL.md
@@ -1,6 +1,6 @@
# AD Smart Pickup — user manual
-Version 1.18.3 · Farming Simulator 25 · add-on for AutoDrive
+Version 1.18.4 · Farming Simulator 25 · add-on for AutoDrive
*Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*
@@ -278,6 +278,7 @@ Under **From** you can pick:
| **Silo** | The silo's contents |
| **Barn** | Milk, slurry and manure from the barn's loading points, including attached extension tanks such as Milk Tank Extension |
| **Object storage** | Pallets and bales. They are taken out one at a time |
+| **Storage** | Other buildings with a loading station, such as the Pumps & Hoses separator hall with digestate. The goods are read from the loading station |
**Sources with shared storage:** some storages are extensions that share their stock with everything
within a set distance, such as a row of milk tanks. Loading at one empties them all. The mod detects
diff --git a/tests/test_adBuildings.lua b/tests/test_adBuildings.lua
index 537f98e..cb3ad07 100644
--- a/tests/test_adBuildings.lua
+++ b/tests/test_adBuildings.lua
@@ -149,5 +149,18 @@ do
check("B-DOB almindelig silo stadig ikke mål", byIdDob.silo1.canBeTarget, false)
end
+-- B-SEP: bygning med læssestation men uden silo/fabrik/stald-spec (Pumps&Hoses separatorhal: digestat-udlevering)
+do
+ local sep = placeable("sep1", "Separator Hall", 7000, 0, {spec_manureSeparator = {}})
+ table.insert(loadStations, {owningPlaceable = sep, loadTriggers = {{triggerNode = {x = 7000, z = 5}}}})
+ addMarker(41, "Digestate pickup", "Biogas", 7000, 10)
+ ADBuildings.invalidate()
+ local bySep = {}
+ for _, b in ipairs(ADBuildings.list(adEnv, 1)) do bySep[b.id] = b end
+ check("B-SEP findes som lager", bySep.sep1 and bySep.sep1.kind, "storage")
+ check("B-SEP kan være kilde", bySep.sep1 and bySep.sep1.canBeSource, true)
+ check("B-SEP læssemarkør", bySep.sep1 and bySep.sep1.loadMarker and bySep.sep1.loadMarker.id, 41)
+end
+
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)
diff --git a/tests/test_adSources.lua b/tests/test_adSources.lua
index 96a1483..03b17cd 100644
--- a/tests/test_adSources.lua
+++ b/tests/test_adSources.lua
@@ -377,6 +377,18 @@ local tankProducts = ADSources.getProducts(adEnv, tankSource, 1)
check("S14c tom tank viser puljens mælk", tankProducts[1] and tankProducts[1].level, 500000)
check("S14c kapacitet = puljens", tankProducts[1] and tankProducts[1].capacity, 70000000)
+-- S14d: generelt lager (separatorhal): kilde via læssestationen, varer = stationens niveauer
+local DIGESTATE = 30
+DESC[DIGESTATE] = {index = DIGESTATE, name = "DIGESTATE", title = "Digestat"}
+local separator = {rootNode = {x = 7000, z = 0}, ownerFarmId = 1, getOwnerFarmId = function() return 1 end, getName = function() return "Separator Hall" end, spec_manureSeparator = {}}
+local sepStation = {owningPlaceable = separator, supportedFillTypes = {[DIGESTATE] = true}, getAllFillLevels = function() return {[DIGESTATE] = 42000}, 200000 end}
+addMarker(77, "Digestate pickup", 7000, 10); loadAt[77] = sepStation
+local sepSource = ADSources.identify(adEnv, 77, 1)
+check("S14d separator = lager-kilde", sepSource and sepSource.kind, "storage")
+local sepProducts = sepSource and ADSources.getProducts(adEnv, sepSource, 1) or {}
+check("S14d digestat fra stationen", sepProducts[1] and sepProducts[1].fillType, DIGESTATE)
+check("S14d mængde", sepProducts[1] and sepProducts[1].level, 42000)
+
-- S15: forklaring af en markør til advarslen (hvad opslaget ser)
check("S15 forklaring stald", ADSources.explainMarker(adEnv, 10, 1), "læssestation ved markøren hører til 'Kostald' (stald)")
check("S15 forklaring ingen station", ADSources.explainMarker(adEnv, 4, 1), "ingen læssestation ved markøren, og ingen fabrik/objektlager inden for 40 m")