Merge pull request #93993 from Chaosus/astargrid2d_update_fix

Add a check to prevent user to call `AStarGrid2D::update` when its not needed
This commit is contained in:
Rémi Verschelde 2024-07-07 12:38:44 +02:00
commit 5bc5ea898c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 0 deletions

View File

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