소스 검색

Fix crash when deleting terrains

HolonProduction 2 년 전
부모
커밋
89c39c7f9d
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      scene/resources/tile_set.cpp

+ 2 - 0
scene/resources/tile_set.cpp

@@ -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++) {