feat: bistadernes pallespawner som udkørselskilde for honning (1.62.362)
This commit is contained in:
@@ -67,9 +67,23 @@ local function getKind(placeable)
|
||||
if placeable.spec_silo ~= nil then return "silo" end
|
||||
if placeable.getHusbandryFillLevel ~= nil then return "husbandry" end
|
||||
if placeable.spec_objectStorage ~= nil then return "objectStorage" end
|
||||
-- bistadernes pallespawner (honning): en ren pallekilde som hønsehusets æg, men uden stald
|
||||
if ADUtil.beehivePalletSpawner(placeable) ~= nil then return "beehive" end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Ren: en pallespawners pladser (for varen, ADUtil.spawnPlaces) som én læssegruppe (isSpawner) | nil når ingen plads
|
||||
-- har en startNode.
|
||||
function ADBuildings.spawnerGroup(spawner, fillType)
|
||||
local nodes = {}
|
||||
for _, place in ipairs(ADUtil.spawnPlaces(spawner, fillType)) do
|
||||
if place.startNode ~= nil then table.insert(nodes, place.startNode) end
|
||||
end
|
||||
if #nodes == 0 then return nil end
|
||||
nodes.isSpawner = true
|
||||
return nodes
|
||||
end
|
||||
|
||||
local logHusbandryFoodOnce
|
||||
ADBuildings.findTriggerNodes = function(root, maxDepth) return ADSupplyPlanner.findTriggerNodes(root, maxDepth) end
|
||||
|
||||
@@ -113,16 +127,11 @@ local function collectNodes(placeable, loadStations, unloadStations)
|
||||
end
|
||||
local productionPoint = getProductionPoint(placeable)
|
||||
local spawner = productionPoint ~= nil and productionPoint.palletSpawner or nil
|
||||
if spawner ~= nil then
|
||||
local nodes = {}
|
||||
for _, place in ipairs(spawner.spawnPlaces or {}) do
|
||||
if place.startNode ~= nil then table.insert(nodes, place.startNode) end
|
||||
end
|
||||
if #nodes > 0 then
|
||||
nodes.isSpawner = true
|
||||
table.insert(loadGroups, nodes)
|
||||
end
|
||||
end
|
||||
local factoryGroup = ADBuildings.spawnerGroup(spawner)
|
||||
if factoryGroup ~= nil then table.insert(loadGroups, factoryGroup) end
|
||||
-- bistadernes pallespawner: én læssegruppe ved pallepladserne ("Honey Pickup")
|
||||
local hiveGroup = ADBuildings.spawnerGroup(ADUtil.beehivePalletSpawner(placeable)) -- (spawner, HONEY)
|
||||
if hiveGroup ~= nil then table.insert(loadGroups, hiveGroup) end
|
||||
-- staldens foder-trigger fra foderdataene (hønsehus: kun den; CM-freestall: stationen har kun halm/gylle/mælk,
|
||||
-- fodertruget ligger for sig — in-game 12/10). Kun noder der ikke allerede er med.
|
||||
if placeable.getHusbandryFillLevel ~= nil then
|
||||
@@ -142,14 +151,8 @@ local function collectNodes(placeable, loadStations, unloadStations)
|
||||
for _, palletSpawner in pairs(husbandryPallets ~= nil and husbandryPallets.fillTypeIndexToPalletSpawner or {}) do
|
||||
if not seenSpawners[palletSpawner] then
|
||||
seenSpawners[palletSpawner] = true
|
||||
local nodes = {}
|
||||
for _, place in ipairs(palletSpawner.spawnPlaces or {}) do
|
||||
if place.startNode ~= nil then table.insert(nodes, place.startNode) end
|
||||
end
|
||||
if #nodes > 0 then
|
||||
nodes.isSpawner = true
|
||||
table.insert(loadGroups, nodes)
|
||||
end
|
||||
local nodes = ADBuildings.spawnerGroup(palletSpawner)
|
||||
if nodes ~= nil then table.insert(loadGroups, nodes) end
|
||||
end
|
||||
end
|
||||
if placeable.spec_objectStorage ~= nil and placeable.rootNode ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user