Guest User

Untitled

a guest
Jul 30th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. local get_tiles = function()
  2. local mask = game.tile_prototypes["transport-drone-road"].collision_mask
  3. local tiles = {}
  4. for name, tile in pairs (game.tile_prototypes) do
  5. local tile_mask = tile.collision_mask
  6. if tile_mask ~= nil then -- added to fix crash
  7. if table_size(tile_mask) == table_size(mask) then
  8. local good = true
  9. for layer, bool in pairs (mask) do
  10. if not tile_mask[layer] then
  11. good = false
  12. break
  13. end
  14. end
  15. if good then
  16. table.insert(tiles, name)
  17. end
  18. end
  19. end -- added to fix crash
  20. end
  21. return tiles
  22. end
Advertisement
Add Comment
Please, Sign In to add comment