1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 22:18:34 +01:00

only return non-blank tiles in TiledExtensions

This commit is contained in:
Ellpeck 2020-01-14 14:46:06 +01:00
parent 1ec8416ab7
commit deaa841657

View file

@ -76,8 +76,11 @@ namespace MLEM.Extended.Tiled {
} }
public static IEnumerable<TiledMapTile> GetTiles(this TiledMap map, int x, int y) { public static IEnumerable<TiledMapTile> GetTiles(this TiledMap map, int x, int y) {
foreach (var layer in map.TileLayers) foreach (var layer in map.TileLayers) {
yield return layer.GetTile(x, y); var tile = layer.GetTile(x, y);
if (!tile.IsBlank)
yield return tile;
}
} }
public static TiledMapTile GetTile(this TiledMapTileLayer layer, int x, int y) { public static TiledMapTile GetTile(this TiledMapTileLayer layer, int x, int y) {