浏览代码

Fix possible infinite loop with bucket fill tool

(cherry picked from commit 3571087843d594b927c9c76cf12483371c6a7ca5)
Marcelo Fernandez 8 年之前
父节点
当前提交
be4b63a257
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      editor/plugins/tile_map_editor_plugin.cpp

+ 4 - 0
editor/plugins/tile_map_editor_plugin.cpp

@@ -341,6 +341,10 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase,
 		return DVector<Vector2>();
 		return DVector<Vector2>();
 	}
 	}
 
 
+	if (id == prev_id) {
+		return PoolVector<Vector2>();
+	}
+
 	Rect2i r = node->get_item_rect();
 	Rect2i r = node->get_item_rect();
 	r.pos = r.pos / node->get_cell_size();
 	r.pos = r.pos / node->get_cell_size();
 	r.size = r.size / node->get_cell_size();
 	r.size = r.size / node->get_cell_size();