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.
This commit is contained in:
Rémi Verschelde 2022-07-08 11:30:28 +02:00 committed by GitHub
commit 13346ab4cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;