Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local get_tiles = function()
- local mask = game.tile_prototypes["transport-drone-road"].collision_mask
- local tiles = {}
- for name, tile in pairs (game.tile_prototypes) do
- local tile_mask = tile.collision_mask
- if tile_mask ~= nil then -- added to fix crash
- if table_size(tile_mask) == table_size(mask) then
- local good = true
- for layer, bool in pairs (mask) do
- if not tile_mask[layer] then
- good = false
- break
- end
- end
- if good then
- table.insert(tiles, name)
- end
- end
- end -- added to fix crash
- end
- return tiles
- end
Advertisement
Add Comment
Please, Sign In to add comment