浏览代码

TileMap: Fix infinite loop when trying to bucket-delete empty tiles.

Right-clicking when the bucket tool is enabled means "erase all instances of this tile".
So it doesn't make sense to try doing this for empty tiles :P

Fixes #10065

(cherry picked from commit 95da12212beb6ab947de5ebbb0d12ffba3d2006c)
Andreas Haas 8 年之前
父节点
当前提交
b694f58959
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      editor/plugins/tile_map_editor_plugin.cpp

+ 2 - 0
editor/plugins/tile_map_editor_plugin.cpp

@@ -330,6 +330,8 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase,
 
 
 		if (id == TileMap::INVALID_CELL)
 		if (id == TileMap::INVALID_CELL)
 			return DVector<Vector2>();
 			return DVector<Vector2>();
+	} else if (prev_id == TileMap::INVALID_CELL) {
+		return DVector<Vector2>();
 	}
 	}
 
 
 	Rect2i r = node->get_item_rect();
 	Rect2i r = node->get_item_rect();