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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user