diff --git a/MLEM.Extended/Tiled/TiledExtensions.cs b/MLEM.Extended/Tiled/TiledExtensions.cs
index 77bffec..706c1eb 100644
--- a/MLEM.Extended/Tiled/TiledExtensions.cs
+++ b/MLEM.Extended/Tiled/TiledExtensions.cs
@@ -190,16 +190,17 @@ namespace MLEM.Extended.Tiled {
}
///
- /// Sets the tiled map tile at the given location to the given tile from the given tileset
+ /// Sets the tiled map tile at the given location to the given tile from the given tileset.
+ /// If the passed or is null, the tile at the location is removed instead.
///
/// The map
/// The name of the layer
/// The x coordinate
/// The y coordinate
- /// The tileset to useR
- /// The tile to place, from the given tileset
+ /// The tileset to use, or null to remove the tile
+ /// The tile to place, from the given tileset, or null to remove the tile
public static void SetTile(this TiledMap map, string layerName, int x, int y, TiledMapTileset tileset, TiledMapTilesetTile tile) {
- map.SetTile(layerName, x, y, tile.GetGlobalIdentifier(tileset, map));
+ map.SetTile(layerName, x, y, tileset != null && tile != null ? tile.GetGlobalIdentifier(tileset, map) : 0);
}
///