diff options
| author | Ferenc Arn | 2017-05-21 14:55:21 -0500 |
|---|---|---|
| committer | Ferenc Arn | 2017-05-21 15:13:09 -0500 |
| commit | e4eb093c62044cdce05ada0e0a42011c7e6628cf (patch) | |
| tree | 0981c7b3671f1188711e5540b35f5b0e2086f61f /core/math/a_star.cpp | |
| parent | 5b3709d3096df737b8bb2344446be818b0389bfe (diff) | |
| download | godot-e4eb093c62044cdce05ada0e0a42011c7e6628cf.tar.gz godot-e4eb093c62044cdce05ada0e0a42011c7e6628cf.tar.zst godot-e4eb093c62044cdce05ada0e0a42011c7e6628cf.zip | |
Diffstat (limited to 'core/math/a_star.cpp')
| -rw-r--r-- | core/math/a_star.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 7e061359f..fa8414427 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -43,6 +43,7 @@ int AStar::get_available_point_id() const { void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { ERR_FAIL_COND(p_id < 0); + ERR_FAIL_COND(p_weight_scale < 1); if (!points.has(p_id)) { Point *pt = memnew(Point); pt->id = p_id; @@ -221,7 +222,6 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { real_t cost = p->distance; cost += _estimate_cost(p->id, end_point->id); - cost *= p->weight_scale; if (cost < least_cost) { |
