***NOTE When I say biter I mean a unit group with at least one unit.
A biter kills a chunk of rail, the on death fires with the entity
Code: Select all
  local repairPosition = entity.position
    local repairName = entity.name
    local repairForce = entity.force
    local repairDirection = entity.direction
    entity.destroy()
    local entityRepaired = surface.create_entity({position=repairPosition,
                    name=repairName,
                    direction=repairDirection,
                    force=repairForce})
    entityRepaired.destructible = false
The next unit group of biters passes by the indestructible rails and begins attacking them.
I control biter movement through attack area commands with distraction by_enemy or by_anything and never set individual targets.


