Skip to content

Commit a07fa3f

Browse files
authored
Merge pull request #947 from Spartan322/4.3.1-cherry-pick/bugs-misc
[4.3] Cherry-picks for the 4.3 (4.3.1) branch - 1st misc bugs batch
2 parents af00a96 + 05bffa8 commit a07fa3f

File tree

70 files changed

+1361
-1402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1361
-1402
lines changed

core/math/a_star.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ Vector3 AStar3D::get_closest_position_in_segment(const Vector3 &p_point) const {
321321
return closest_point;
322322
}
323323

324-
bool AStar3D::_solve(Point *begin_point, Point *end_point) {
324+
bool AStar3D::_solve(Point *begin_point, Point *end_point, bool p_allow_partial_path) {
325325
last_closest_point = nullptr;
326326
pass++;
327327

328-
if (!end_point->enabled) {
328+
if (!end_point->enabled && !p_allow_partial_path) {
329329
return false;
330330
}
331331

@@ -445,7 +445,7 @@ Vector<Vector3> AStar3D::get_point_path(int64_t p_from_id, int64_t p_to_id, bool
445445
Point *begin_point = a;
446446
Point *end_point = b;
447447

448-
bool found_route = _solve(begin_point, end_point);
448+
bool found_route = _solve(begin_point, end_point, p_allow_partial_path);
449449
if (!found_route) {
450450
if (!p_allow_partial_path || last_closest_point == nullptr) {
451451
return Vector<Vector3>();
@@ -499,7 +499,7 @@ Vector<int64_t> AStar3D::get_id_path(int64_t p_from_id, int64_t p_to_id, bool p_
499499
Point *begin_point = a;
500500
Point *end_point = b;
501501

502-
bool found_route = _solve(begin_point, end_point);
502+
bool found_route = _solve(begin_point, end_point, p_allow_partial_path);
503503
if (!found_route) {
504504
if (!p_allow_partial_path || last_closest_point == nullptr) {
505505
return Vector<int64_t>();
@@ -728,7 +728,7 @@ Vector<Vector2> AStar2D::get_point_path(int64_t p_from_id, int64_t p_to_id, bool
728728
AStar3D::Point *begin_point = a;
729729
AStar3D::Point *end_point = b;
730730

731-
bool found_route = _solve(begin_point, end_point);
731+
bool found_route = _solve(begin_point, end_point, p_allow_partial_path);
732732
if (!found_route) {
733733
if (!p_allow_partial_path || astar.last_closest_point == nullptr) {
734734
return Vector<Vector2>();
@@ -782,7 +782,7 @@ Vector<int64_t> AStar2D::get_id_path(int64_t p_from_id, int64_t p_to_id, bool p_
782782
AStar3D::Point *begin_point = a;
783783
AStar3D::Point *end_point = b;
784784

785-
bool found_route = _solve(begin_point, end_point);
785+
bool found_route = _solve(begin_point, end_point, p_allow_partial_path);
786786
if (!found_route) {
787787
if (!p_allow_partial_path || astar.last_closest_point == nullptr) {
788788
return Vector<int64_t>();
@@ -818,11 +818,11 @@ Vector<int64_t> AStar2D::get_id_path(int64_t p_from_id, int64_t p_to_id, bool p_
818818
return path;
819819
}
820820

821-
bool AStar2D::_solve(AStar3D::Point *begin_point, AStar3D::Point *end_point) {
821+
bool AStar2D::_solve(AStar3D::Point *begin_point, AStar3D::Point *end_point, bool p_allow_partial_path) {
822822
astar.last_closest_point = nullptr;
823823
astar.pass++;
824824

825-
if (!end_point->enabled) {
825+
if (!end_point->enabled && !p_allow_partial_path) {
826826
return false;
827827
}
828828

core/math/a_star.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class AStar3D : public RefCounted {
117117
HashSet<Segment, Segment> segments;
118118
Point *last_closest_point = nullptr;
119119

120-
bool _solve(Point *begin_point, Point *end_point);
120+
bool _solve(Point *begin_point, Point *end_point, bool p_allow_partial_path);
121121

122122
protected:
123123
static void _bind_methods();
@@ -173,7 +173,7 @@ class AStar2D : public RefCounted {
173173
GDCLASS(AStar2D, RefCounted);
174174
AStar3D astar;
175175

176-
bool _solve(AStar3D::Point *begin_point, AStar3D::Point *end_point);
176+
bool _solve(AStar3D::Point *begin_point, AStar3D::Point *end_point, bool p_allow_partial_path);
177177

178178
protected:
179179
static void _bind_methods();

0 commit comments

Comments
 (0)