[0.15.5] attack area targets indestructible entities

This subforum contains all the issues which we already resolved.
Post Reply
Veden
Filter Inserter
Filter Inserter
Posts: 294
Joined: Wed Jul 13, 2016 3:54 pm
Contact:

[0.15.5] attack area targets indestructible entities

Post 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.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.15.5] attack area targets indestructible entities

Post by kovarex »

Could you give me step by step description of how to reproduce the issue?

Veden
Filter Inserter
Filter Inserter
Posts: 294
Joined: Wed Jul 13, 2016 3:54 pm
Contact:

Re: [0.15.5] attack area targets indestructible entities

Post 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.

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.15.5] attack area targets indestructible entities

Post by Oxyd »

Thanks, fixed in 0.15.13.

Post Reply

Return to “Resolved Problems and Bugs”