diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/engine.h | 1 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 6 | ||||
-rw-r--r-- | core/math/a_star.cpp | 22 | ||||
-rw-r--r-- | core/object.cpp | 5 |
4 files changed, 13 insertions, 21 deletions
diff --git a/core/engine.h b/core/engine.h index b3c385c9f8..82b1e5d681 100644 --- a/core/engine.h +++ b/core/engine.h @@ -125,6 +125,7 @@ public: String get_license_text() const; Engine(); + virtual ~Engine() {} }; #endif // ENGINE_H diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index d33d436b74..628019ef7f 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -807,7 +807,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo case Variant::INT: { int64_t val = p_variant; - if (val > 0x7FFFFFFF || val < -0x80000000) { + if (val > (int64_t)INT_MAX || val < (int64_t)INT_MIN) { flags |= ENCODE_FLAG_64; } } break; @@ -851,7 +851,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo case Variant::INT: { int64_t val = p_variant; - if (val > 0x7FFFFFFF || val < -0x80000000) { + if (flags & ENCODE_FLAG_64) { //64 bits if (buf) { encode_uint64(val, buf); @@ -870,7 +870,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo double d = p_variant; float f = d; - if (double(f) != d) { + if (flags & ENCODE_FLAG_64) { if (buf) { encode_double(p_variant.operator double(), buf); } diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index e4f93289e9..451c45cade 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -250,14 +250,9 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { n->distance = _compute_cost(begin_point->id, n->id) * n->weight_scale; n->last_pass = pass; open_list.add(&n->list); - - if (end_point == n) { - found_route = true; - break; - } } - while (!found_route) { + while (true) { if (open_list.first() == NULL) { // No path found @@ -277,13 +272,16 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { cost += _estimate_cost(p->id, end_point->id); if (cost < least_cost) { - least_cost_point = E; least_cost = cost; } } Point *p = least_cost_point->self(); + if (p == end_point) { + found_route = true; + break; + } for (Set<Point *>::Element *E = p->neighbours.front(); E; E = E->next()) { @@ -295,7 +293,6 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { // Already visited, is this cheaper? if (e->distance > distance) { - e->prev_point = p; e->distance = distance; } @@ -306,18 +303,9 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { e->distance = distance; e->last_pass = pass; // Mark as used open_list.add(&e->list); - - if (e == end_point) { - // End reached; stop algorithm - found_route = true; - break; - } } } - if (found_route) - break; - open_list.remove(least_cost_point); } diff --git a/core/object.cpp b/core/object.cpp index 345c018e6d..946040ba34 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1254,7 +1254,10 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int target->call(c.method, args, argc, ce); if (ce.error != Variant::CallError::CALL_OK) { - +#ifdef DEBUG_ENABLED + if (c.flags & CONNECT_PERSIST && Engine::get_singleton()->is_editor_hint() && (script.is_null() || !Ref<Script>(script)->is_tool())) + continue; +#endif if (ce.error == Variant::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) { //most likely object is not initialized yet, do not throw error. } else { |