summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/math/a_star.cpp6
-rw-r--r--modules/gdnative/gdnative/array.cpp4
-rw-r--r--modules/gdnative/pluginscript/pluginscript_language.cpp2
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp2
4 files changed, 10 insertions, 4 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index 7ce3824505..b61119d8df 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -216,6 +216,8 @@ int AStar::get_closest_point(const Vector3 &p_point) const {
for (const Map<int, Point *>::Element *E = points.front(); E; E = E->next()) {
+ if (!E->get()->enabled)
+ continue; //Disabled points should not be considered
real_t d = p_point.distance_squared_to(E->get()->pos);
if (closest_id < 0 || d < closest_dist) {
closest_dist = d;
@@ -234,6 +236,10 @@ Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const {
for (const Set<Segment>::Element *E = segments.front(); E; E = E->next()) {
+ if (!(E->get().from_point->enabled && E->get().to_point->enabled)) {
+ continue;
+ }
+
Vector3 segment[2] = {
E->get().from_point->pos,
E->get().to_point->pos,
diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp
index 6849ff03d7..1ef8e9f900 100644
--- a/modules/gdnative/gdnative/array.cpp
+++ b/modules/gdnative/gdnative/array.cpp
@@ -305,13 +305,13 @@ void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, con
godot_int GDAPI godot_array_bsearch(godot_array *p_self, const godot_variant *p_value, const godot_bool p_before) {
Array *self = (Array *)p_self;
- return self->bsearch((const Variant *)p_value, p_before);
+ return self->bsearch(*(const Variant *)p_value, p_before);
}
godot_int GDAPI godot_array_bsearch_custom(godot_array *p_self, const godot_variant *p_value, godot_object *p_obj, const godot_string *p_func, const godot_bool p_before) {
Array *self = (Array *)p_self;
const String *func = (const String *)p_func;
- return self->bsearch_custom((const Variant *)p_value, (Object *)p_obj, *func, p_before);
+ return self->bsearch_custom(*(const Variant *)p_value, (Object *)p_obj, *func, p_before);
}
void GDAPI godot_array_destroy(godot_array *p_self) {
diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp
index 7cb47ec623..4bbadc62e7 100644
--- a/modules/gdnative/pluginscript/pluginscript_language.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_language.cpp
@@ -216,7 +216,7 @@ void PluginScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_
Dictionary constants;
_desc.get_public_constants(_data, (godot_dictionary *)&constants);
for (const Variant *key = constants.next(); key; key = constants.next(key)) {
- Variant value = constants[key];
+ Variant value = constants[*key];
p_constants->push_back(Pair<String, Variant>(*key, value));
}
}
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp
index 1d6f9db349..310fa7000e 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_script.cpp
@@ -284,7 +284,7 @@ Error PluginScript::reload(bool p_keep_state) {
Dictionary *members = (Dictionary *)&manifest.member_lines;
for (const Variant *key = members->next(); key != NULL; key = members->next(key)) {
- _member_lines[*key] = (*members)[key];
+ _member_lines[*key] = (*members)[*key];
}
Array *methods = (Array *)&manifest.methods;
for (int i = 0; i < methods->size(); ++i) {