Merge pull request #79618 from HolonProduction/deleting-terrains-crash

Fix crash when deleting tileset terrains
This commit is contained in:
Yuri Sizov 2023-07-21 17:15:48 +02:00
commit 7835d42971

View File

@ -5116,6 +5116,8 @@ void TileData::remove_terrain(int p_terrain_set, int p_index) {
if (terrain_set == p_terrain_set) {
if (terrain == p_index) {
terrain = -1;
} else if (terrain > p_index) {
terrain -= 1;
}
for (int i = 0; i < 16; i++) {