浏览代码

Merge pull request #93993 from Chaosus/astargrid2d_update_fix

Add a check to prevent user to call `AStarGrid2D::update` when its not needed
Rémi Verschelde 1 年之前
父节点
当前提交
5bc5ea898c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      core/math/a_star_grid_2d.cpp

+ 4 - 0
core/math/a_star_grid_2d.cpp

@@ -122,6 +122,10 @@ AStarGrid2D::CellShape AStarGrid2D::get_cell_shape() const {
 }
 
 void AStarGrid2D::update() {
+	if (!dirty) {
+		return;
+	}
+
 	points.clear();
 
 	const int32_t end_x = region.get_end().x;