diff --git a/MLEM.Extended/Tiled/TiledMapCollisions.cs b/MLEM.Extended/Tiled/TiledMapCollisions.cs index a63ce4c..3eb8065 100644 --- a/MLEM.Extended/Tiled/TiledMapCollisions.cs +++ b/MLEM.Extended/Tiled/TiledMapCollisions.cs @@ -38,7 +38,7 @@ namespace MLEM.Extended.Tiled { return; } var tilesetTile = tile.GetTilesetTile(this.map); - this.collisionInfos[layerIndex, x, y] = new TileCollisionInfo(this.map, new Vector2(x, y), tile, tilesetTile); + this.collisionInfos[layerIndex, x, y] = new TileCollisionInfo(this.map, new Vector2(x, y), tile, layer, tilesetTile); } public IEnumerable GetCollidingTiles(RectangleF area, Func included = null) { @@ -67,11 +67,13 @@ namespace MLEM.Extended.Tiled { public class TileCollisionInfo { public readonly TiledMapTile Tile; + public readonly TiledMapTileLayer Layer; public readonly TiledMapTilesetTile TilesetTile; public readonly ReadOnlyCollection Collisions; - public TileCollisionInfo(TiledMap map, Vector2 position, TiledMapTile tile, TiledMapTilesetTile tilesetTile) { + public TileCollisionInfo(TiledMap map, Vector2 position, TiledMapTile tile, TiledMapTileLayer layer, TiledMapTilesetTile tilesetTile) { this.TilesetTile = tilesetTile; + this.Layer = layer; this.Tile = tile; var collisions = new List();