fix dangling reference crash on tile unloading

This commit is contained in:
Skarn
2022-02-03 14:52:35 +03:00
parent 036fe1bda6
commit 3b38f69d00

View File

@@ -413,8 +413,8 @@ void MapIndex::unloadTile(const TileIndex& tile)
// unloads a tile with givn cords
if (tileLoaded(tile))
{
mTiles[tile.z][tile.x].tile = nullptr;
Log << "Unload Tile " << tile.x << "-" << tile.z << std::endl;
mTiles[tile.z][tile.x].tile = nullptr;
_n_loaded_tiles--;
}
}