diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-04-02 14:52:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 14:52:36 +0200 |
commit | 058a0afdeca83145d58a95c426dd01216c397ea9 (patch) | |
tree | be0cd59e5a90926e9d653fed9f3b1b77e735ca2f /core/math/a_star.cpp | |
parent | 5f11e1557156617366d2c316a97716172103980d (diff) | |
parent | 95a1400a2ac9de1a29fa305f45b928ce8e3044bd (diff) | |
download | redot-engine-058a0afdeca83145d58a95c426dd01216c397ea9.tar.gz |
Merge pull request #37338 from lupoDharkael/nullprt
Replace NULL with nullptr
Diffstat (limited to 'core/math/a_star.cpp')
-rw-r--r-- | core/math/a_star.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index bfff12ac45..3e3e6c50a7 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -66,7 +66,7 @@ void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { pt->id = p_id; pt->pos = p_pos; pt->weight_scale = p_weight_scale; - pt->prev_point = NULL; + pt->prev_point = nullptr; pt->open_pass = 0; pt->closed_pass = 0; pt->enabled = true; @@ -167,7 +167,7 @@ void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) { if (bidirectional) s.direction = Segment::BIDIRECTIONAL; Set<Segment>::Element *element = segments.find(s); - if (element != NULL) { + if (element != nullptr) { s.direction |= element->get().direction; if (s.direction == Segment::BIDIRECTIONAL) { // Both are neighbours of each other now @@ -194,7 +194,7 @@ void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) { int remove_direction = bidirectional ? (int)Segment::BIDIRECTIONAL : s.direction; Set<Segment>::Element *element = segments.find(s); - if (element != NULL) { + if (element != nullptr) { // s is the new segment // Erase the directions to be removed s.direction = (element->get().direction & ~remove_direction); @@ -255,7 +255,7 @@ bool AStar::are_points_connected(int p_id, int p_with_id, bool bidirectional) co Segment s(p_id, p_with_id); const Set<Segment>::Element *element = segments.find(s); - return element != NULL && + return element != nullptr && (bidirectional || (element->get().direction & s.direction) == s.direction); } |