Calling surface.create_entity{fast_replace=true} on an unminable machine creates target entity but fails to remove the original and does not transfer settings or inventory.
(As discussed in this thread.)
Expected?
The fast_replace attempt should fail as the target is unminable. Or succeed if script is supposed to ignore this. But not stop half-way through.
Reproduction
This will spawn the broken state:
Code: Select all
/c
local p = game.player
local pos = {p.position.x + 0, p.position.y - 5}
one = p.surface.create_entity{
name = 'assembling-machine-1',
position = pos,
force = p.force,
create_build_effect_smoke = false,
}
one.minable = false
one.set_recipe('iron-gear-wheel')
one.insert'iron-plate'
two = p.surface.create_entity{
name = 'assembling-machine-3',
position = pos,
force = p.force,
fast_replace = true,
spill = false,
create_build_effect_smoke = true,
}
game.print('one:'..tostring(one.valid))
game.print('two:'..tostring(two.valid))
Code: Select all
/c
one.teleport(-3,0)
The two same-position machines do not suffer from the "flickering" i saw with the overlapping ores.