Skip to content

Commit

Permalink
Merge pull request #93993 from Chaosus/astargrid2d_update_fix
Browse files Browse the repository at this point in the history
Add a check to prevent user to call `AStarGrid2D::update` when its not needed
  • Loading branch information
akien-mga committed Jul 7, 2024
2 parents 50373e6 + 453c875 commit 5bc5ea8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/math/a_star_grid_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5bc5ea8

Please sign in to comment.