Repair Turret 2

by tiko13

A fork of Klonan's Repair Turret mod. It aims for repair turrets to be a complete replacement of construction bots (Logistic over time as well)

Content
a month ago
2.0
2.46K
Logistics Logistic network

b Item duplication with linked-container protype

6 days ago

When deconstructing linked chest, the repair turret places a copy of all the items in the linked chest to the output container. Since linked chest store items in channels, this creates a duplicate copy of all the items and leaves the item in the linked chest channel in place. I end up having to add a exception for linked chest in the inventory handler and the entity.mine call to fix the issue, but I am sure there's better methods out there that can do it.

In repair_turret/script/repair_turret.lua, deconstruct_entity,
line 2725:
local container_inv = nil
if entity.type ~= "linked-container" then
container_inv = entity.get_inventory(defines.inventory.chest)
end
line 2793:
local success = false
if entity.type == "linked-container" then
for _, product in pairs(get_mineable_products(entity)) do
if product.type ~= "fluid" then
inventory.insert(product)
end
end
success = entity.destroy()
else
success = entity.mine
{
inventory = inventory
}
end

New response