This commit is contained in:
2025-05-23 13:35:13 +09:00
parent 854502da57
commit 4b97cce4e6

View File

@@ -97,12 +97,14 @@ script.on_nth_tick(3600, function(_)
local inv = e.get_inventory(defines.inventory.cargo_landing_pad_main) local inv = e.get_inventory(defines.inventory.cargo_landing_pad_main)
if inv then if inv then
for _, v in pairs(inv) do local item = inv.get_contents()
if ic[v.name] and (ic[v.name].quality == v.quality) and (ic[v.name].health == v.health) and (ic[v.name].spoil_tick == v.spoil_tick) and (ic[v.name].durability == v.durability) then
for _, v in pairs(item) do
if ic[v.name] and (ic[v.name].quality == v.quality) then
ic[v.name].count = ic[v.name].count + v.count ic[v.name].count = ic[v.name].count + v.count
else else
ic[v.name] = {count = v.count, quality = v.quality, health = v.health, spoil_tick = v.spoil_tick, durability = v.durability} ic[v.name] = {count = v.count, quality = v.quality}
end end
end end
@@ -116,12 +118,12 @@ script.on_nth_tick(3600, function(_)
if c > 0 then if c > 0 then
for _, e in ipairs(ec) do for _, e in ipairs(ec) do
e.insert{name = k, count = c, quality = v.quality, health = v.health, spoil_tick = v.spoil_tick, durability = v.durability} e.insert{name = k, count = c, quality = v.quality}
end end
end end
if remainder > 0 then if remainder > 0 then
ec[1].insert{name = k, count = remainder, quality = v.quality, health = v.health, spoil_tick = v.spoil_tick, durability = v.durability} ec[1].insert{name = k, count = remainder, quality = v.quality}
end end
end end
end end