diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-06 08:40:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 08:40:12 +0200 |
commit | f70dd61a49450c986f335bf8aad728da5bdb090c (patch) | |
tree | 2835aa0ed883e60f452bff750af4ff6a28c17804 /core | |
parent | f70085a9425e9f4ebfec389604cc8008b01316ab (diff) | |
parent | 868fe4942c70267387a116f2ce57d7bf1a7bbd5e (diff) |
Merge pull request #60811 from smix8/astar_zero_point_weight_4.x
Diffstat (limited to 'core')
-rw-r--r-- | core/math/a_star.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 4212b43621..284b4294ea 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -47,7 +47,7 @@ int AStar3D::get_available_point_id() const { void AStar3D::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { ERR_FAIL_COND_MSG(p_id < 0, vformat("Can't add a point with negative id: %d.", p_id)); - ERR_FAIL_COND_MSG(p_weight_scale < 1, vformat("Can't add a point with weight scale less than one: %f.", p_weight_scale)); + ERR_FAIL_COND_MSG(p_weight_scale < 0.0, vformat("Can't add a point with weight scale less than 0.0: %f.", p_weight_scale)); Point *found_pt; bool p_exists = points.lookup(p_id, found_pt); @@ -96,7 +96,7 @@ void AStar3D::set_point_weight_scale(int p_id, real_t p_weight_scale) { Point *p; bool p_exists = points.lookup(p_id, p); ERR_FAIL_COND_MSG(!p_exists, vformat("Can't set point's weight scale. Point with id: %d doesn't exist.", p_id)); - ERR_FAIL_COND_MSG(p_weight_scale < 1, vformat("Can't set point's weight scale less than one: %f.", p_weight_scale)); + ERR_FAIL_COND_MSG(p_weight_scale < 0.0, vformat("Can't set point's weight scale less than 0.0: %f.", p_weight_scale)); p->weight_scale = p_weight_scale; } |