[SOLVED] Name of tile (mined, placed)
Posted: Sun Jun 03, 2018 12:57 am
Hi developers,
I have found that function LuaSurface::get_tile(x,y) returns LuaTile without values in prototype and name. Booth are "nil"
Solved - be careful with events
*fixed missing tile.name in localized sting, bud it makes no problem, proble makes that, tile.name returns nil
I have found that function LuaSurface::get_tile(x,y) returns LuaTile without values in prototype and name. Booth are "nil"
Solved - be careful with events
Code: Select all
local function on_mined_tile(event)
local surface = game.surfaces[event.surface_index]
local tiles = event.tiles
for _,tile in pairs(tiles) do
set_tile(tile.position.x, tile.position.y, surface.get_tile(tile.position.x, tile.position.y))
end
end