A simple-entity-* that has been made invisible with i.e. render_to_forces = {'enemy'} can still be selected with the mouse cursor.
Expected behavior
Invisible things shouldn't be selectable.
Reproduction
Code: Select all
/c
local p = game.player
for i=1,3 do
for j = 1,3 do
local x = p.surface.create_entity {
name='simple-entity-with-force',
position={p.position.x - 4 + 2*i, p.position.y - 6 + 2*j},
force = game.forces[j]
}
x.render_to_forces = {game.forces[i]}
end
end
2) Move your mouse to select any of the nine entities above you.
Why?
Because I need certain things to be temporarily unselectable for everyone.