From deaa8416570a1a10f991c31c237d2466cc7a398b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 14 Jan 2020 14:46:06 +0100 Subject: [PATCH] only return non-blank tiles in TiledExtensions --- MLEM.Extended/Tiled/TiledExtensions.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MLEM.Extended/Tiled/TiledExtensions.cs b/MLEM.Extended/Tiled/TiledExtensions.cs index a4bb3ab..76dd211 100644 --- a/MLEM.Extended/Tiled/TiledExtensions.cs +++ b/MLEM.Extended/Tiled/TiledExtensions.cs @@ -76,8 +76,11 @@ namespace MLEM.Extended.Tiled { } public static IEnumerable GetTiles(this TiledMap map, int x, int y) { - foreach (var layer in map.TileLayers) - yield return layer.GetTile(x, y); + foreach (var layer in map.TileLayers) { + var tile = layer.GetTile(x, y); + if (!tile.IsBlank) + yield return tile; + } } public static TiledMapTile GetTile(this TiledMapTileLayer layer, int x, int y) {