diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-07-08 11:30:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 11:30:28 +0200 |
commit | 13346ab4cc728490fa7e2ff63b8da1d9cbe97046 (patch) | |
tree | 06bed4a7b2cb3a1b6a95d60e98d25a7ae86160f3 | |
parent | 0e3ac839b4bcf58a0c286fb248a6cadc311b39b0 (diff) | |
parent | 3a37053aac4aa29b653aea7c303f69f367a71f6c (diff) |
Merge pull request #62632 from linkpy/62630_fix
Make sure the tile data clears its `terrain` field when said terrain is removed from the tileset.
-rw-r--r-- | scene/resources/tile_set.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 13b671e562..1e961e870c 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -4924,6 +4924,10 @@ void TileData::move_terrain(int p_terrain_set, int p_from_index, int p_to_pos) { void TileData::remove_terrain(int p_terrain_set, int p_index) { if (terrain_set == p_terrain_set) { + if (terrain == p_index) { + terrain = -1; + } + for (int i = 0; i < 16; i++) { if (terrain_peering_bits[i] == p_index) { terrain_peering_bits[i] = -1; |