From f93117622c04965daa31988bcda664f6a46e1dd6 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 7 Dec 2019 02:08:21 +0100 Subject: [PATCH] made collision infos update properly on tile removal --- MLEM.Extended/Tiled/TiledMapCollisions.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MLEM.Extended/Tiled/TiledMapCollisions.cs b/MLEM.Extended/Tiled/TiledMapCollisions.cs index 84ff91c..902d36b 100644 --- a/MLEM.Extended/Tiled/TiledMapCollisions.cs +++ b/MLEM.Extended/Tiled/TiledMapCollisions.cs @@ -33,11 +33,15 @@ namespace MLEM.Extended.Tiled { public void UpdateCollisionInfo(int layerIndex, int x, int y) { var layer = this.map.TileLayers[layerIndex]; var tile = layer.GetTile(x, y); - if (tile.IsBlank) + if (tile.IsBlank) { + this.collisionInfos[layerIndex, x, y] = null; return; + } var tilesetTile = tile.GetTilesetTile(this.map); - if (tilesetTile == null) + if (tilesetTile == null) { + this.collisionInfos[layerIndex, x, y] = null; return; + } this.collisionInfos[layerIndex, x, y] = new TileCollisionInfo(this.map, new Vector2(x, y), tile, tilesetTile); }