Hi, thanks for the mod! I noticed that the signal wires don't get removed when you remove the entity. I believe to have fixed it by editing the local function OnEntityRemoved(event):
local function OnEntityRemoved(event)
local entity = event.entity
check_state(entity.force)
local link = radio_link(entity)
local link_red = link.get_wire_connector(defines.wire_connector_id.circuit_red)
local link_green = link.get_wire_connector(defines.wire_connector_id.circuit_green)
for _, connection in pairs(link_red.connections) do
link_red.disconnect_from(connection.target, defines.wire_origin.script)
end
for _, connection in pairs(link_green.connections) do
link_green.disconnect_from(connection.target, defines.wire_origin.script)
end
link.destroy()
radio_port(entity).destroy()
check_channels()
end