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