Page 1 of 1

[0.15.5] attack area targets indestructible entities

Posted: Sun Apr 30, 2017 11:03 pm
by Veden
The situation is:

***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 biter that killed the rail moves to the next rail until all in the area are gone, at which point the rails have all been remade with 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.

Re: [0.15.5] attack area targets indestructible entities

Posted: Wed May 17, 2017 2:12 pm
by kovarex
Could you give me step by step description of how to reproduce the issue?

Re: [0.15.5] attack area targets indestructible entities

Posted: Wed May 17, 2017 6:46 pm
by Veden

Code: Select all

     
    local playerPosition = game.players[1].position
    local chunkX = playerPosition.x
    local chunkY = playerPosition.y
    local entity = game.surfaces[1].create_entity({name="small-electric-pole", force="player", position={chunkX - 20, chunkY - 20}})
    entity.destructible = false

    local group = game.surfaces[1].create_unit_group({position={chunkX - 30, chunkY - 30}})

    for i=1,20,1 do
	entity = game.surfaces[1].create_entity({name="small-spitter", force="enemy", position={chunkX - 30 - i, chunkY - 30 - i}})
	group.add_member(entity)
    end

    group.set_command({type = defines.command.attack_area,
		       destination={chunkX, chunkY},
		       radius=48,
		       distraction=defines.distraction.by_anything})
The above code snippet can be dropped into the console and should reproduce the issue.

The group will run by the pole initially and then they will turn around and begin attacking the pole.

Re: [0.15.5] attack area targets indestructible entities

Posted: Thu May 18, 2017 1:53 pm
by Oxyd
Thanks, fixed in 0.15.13.