Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.on_event(defines.events.on_player_built_tile, function(event)
- -- there seems to be an inconsistency in the surface_index, https://forums.factorio.com/viewtopic.php?t=46502
- if event.surface_index + 1 == game.surfaces["nauvis"].index then
- local tiles = {}
- for i = 1, #event.positions do
- if game.surfaces["nauvis"].get_tile(event.positions[i].x, event.positions[i].y).name == "cave-ground" then
- table.insert(tiles, {name="grass", position = event.positions[i] })
- end
- end
- game.surfaces["nauvis"].set_tiles(tiles, true)
- end
- end)
Add Comment
Please, Sign In to add comment