diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 80322432bd..1161a4732d 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -481,6 +481,10 @@ Vector AStar3D::get_id_path(int64_t p_from_id, int64_t p_to_id, bool p_ return ret; } + if (!a->enabled) { + return Vector(); + } + Point *begin_point = a; Point *end_point = b; @@ -764,6 +768,10 @@ Vector AStar2D::get_id_path(int64_t p_from_id, int64_t p_to_id, bool p_ return ret; } + if (!a->enabled) { + return Vector(); + } + AStar3D::Point *begin_point = a; AStar3D::Point *end_point = b;