mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
made collision infos update properly on tile removal
This commit is contained in:
parent
31294f1873
commit
f93117622c
1 changed files with 6 additions and 2 deletions
|
@ -33,11 +33,15 @@ namespace MLEM.Extended.Tiled {
|
||||||
public void UpdateCollisionInfo(int layerIndex, int x, int y) {
|
public void UpdateCollisionInfo(int layerIndex, int x, int y) {
|
||||||
var layer = this.map.TileLayers[layerIndex];
|
var layer = this.map.TileLayers[layerIndex];
|
||||||
var tile = layer.GetTile(x, y);
|
var tile = layer.GetTile(x, y);
|
||||||
if (tile.IsBlank)
|
if (tile.IsBlank) {
|
||||||
|
this.collisionInfos[layerIndex, x, y] = null;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
var tilesetTile = tile.GetTilesetTile(this.map);
|
var tilesetTile = tile.GetTilesetTile(this.map);
|
||||||
if (tilesetTile == null)
|
if (tilesetTile == null) {
|
||||||
|
this.collisionInfos[layerIndex, x, y] = null;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
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, tilesetTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue