Fix AStars to return empty path for disabled from point
#113988
+77
−80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #113975.
#86983 changed only
AStar2D::get_id_path/AStar3D::get_id_pathto return an empty path iffrompoint is disabled.This PR makes the same for:
AStar2D::get_point_pathAStar3D::get_point_pathAStarGrid2D::get_id_path(API-wise forAStarGrid2Dpoints can be "solid" instead of "disabled")AStarGrid2D::get_point_pathFor all
AStars, I've moved the condition checking to the internal_solvemethod used by bothget_id_path/get_point_path.Also previously (even after #86983) e.g.
AStar2D::get_id_path(from, from)for a disabledfromwould still return a single-point path instead of an empty path, asfrom == towas being checked before!from.enabled. Fixed/swapped these checks order as well.Added relevant test case for
AStar3D(AStar2D,AStarGrid2Dhave no tests at all).