diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-21 16:54:53 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-21 16:54:53 +0100 |
commit | 3e9a83119440edbc9d9e03125f57f3b4dd9d964e (patch) | |
tree | 4b2ad3459643a4b0715e8f5ea901726e3540d8e5 /scene | |
parent | ebd0b40f6ec2c1db17fa0561f5a3403913032c3b (diff) | |
parent | 7afaca2091b63c50ae8c9f5809bef9ec7e836db4 (diff) | |
download | redot-engine-3e9a83119440edbc9d9e03125f57f3b4dd9d964e.tar.gz |
Merge pull request #65726 from KoBeWi/cellless
Don't print error in `get_cell_tile_data()`
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 4f282dc0ab..a30b3c900d 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -2073,7 +2073,7 @@ void TileMap::erase_cell(int p_layer, const Vector2i &p_coords) { int TileMap::get_cell_source_id(int p_layer, const Vector2i &p_coords, bool p_use_proxies) const { ERR_FAIL_INDEX_V(p_layer, (int)layers.size(), TileSet::INVALID_SOURCE); - // Get a cell source id from position + // Get a cell source id from position. const HashMap<Vector2i, TileMapCell> &tile_map = layers[p_layer].tile_map; HashMap<Vector2i, TileMapCell>::ConstIterator E = tile_map.find(p_coords); @@ -2129,7 +2129,9 @@ int TileMap::get_cell_alternative_tile(int p_layer, const Vector2i &p_coords, bo TileData *TileMap::get_cell_tile_data(int p_layer, const Vector2i &p_coords, bool p_use_proxies) const { int source_id = get_cell_source_id(p_layer, p_coords, p_use_proxies); - ERR_FAIL_COND_V_MSG(source_id == TileSet::INVALID_SOURCE, nullptr, vformat("Invalid TileSetSource at cell %s. Make sure a tile exists at this cell.", p_coords)); + if (source_id == TileSet::INVALID_SOURCE) { + return nullptr; + } Ref<TileSetAtlasSource> source = tile_set->get_source(source_id); if (source.is_valid()) { |