feat(kilder): generelt lager — bygninger med egen læssestation uden silo/fabrik/stald-spec (P&H separatorhal, digestat) kan vælges under Fra; varer fra stationen (v1.18.4.0)

This commit is contained in:
2026-09-24 13:54:45 +02:00
parent 925163758a
commit fe3a4284c5
9 changed files with 72 additions and 3 deletions
+10
View File
@@ -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