Here is an fix for it if you edit the control.lua file
Starting at line 370
for n,p in pairs(global.unders) do
local maximum = roboport.logistic_network.get_item_count(p.name)
for i,under in pairs(beltlist) do
--game.print("Found an underground belt! Looking for replacement options.")
if maximum > 1 and count < maximum - 1 and p.belt_speed > under.prototype.belt_speed and p.max_underground_distance >= under.prototype.max_underground_distance then --Replace
--triggered = true
game.print("Underground belt replacement option found. Replacing with " .. p.name)
if not under.to_be_deconstructed(force) then
-- Check neighbor to see if we can replace at the same time.
if under.neighbours == nil then --This is an orphaned underground belt
local ghost = roboport.surface.create_entity{name="entity-ghost", position=under.position, inner_name=p.name, direction = under.direction, type=under.belt_to_ground_type, force=roboport.force}
table.insert(global.ghosts, ghost)
--under.order_deconstruction(force)
count = count + 1
break
end
-- We're assuming if it's in logistic range, it's in construction range.
-- This will cause some weird edge cases mods (super long underground belts or roboports with the same construction radius as logistic networks)
--if #under.neighbours == 1 and under.surface.find_logistic_network_by_position(under.position, force) then
if under.neighbours then
local ghost = roboport.surface.create_entity{name="entity-ghost", position=under.position, inner_name=p.name, direction = under.direction, type=under.belt_to_ground_type, force=roboport.force}
table.insert(global.ghosts, ghost)
-- under.order_deconstruction(force)
--Do Neighbor
local ghost = roboport.surface.create_entity{name="entity-ghost", position=under.neighbours.position, inner_name=p.name, direction = under.neighbours.direction, type=under.neighbours.belt_to_ground_type, force=roboport.force}
table.insert(global.ghosts, ghost)
-- under.neighbours[1].order_deconstruction(force)
count = count + 2
--game.print(count .. " " .. amount)
if count >= amount - 1 then --Out of bots.
return
end
end
end
end
end
end