diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative/pool_arrays.cpp | 35 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 49 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/pool_arrays.h | 14 | ||||
-rw-r--r-- | modules/gdscript/gdscript.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 4 |
6 files changed, 104 insertions, 6 deletions
diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp index 74c540ca14..23791af67e 100644 --- a/modules/gdnative/gdnative/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -129,6 +129,11 @@ godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self) return self->size(); } +godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self) { + const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self) { ((PoolVector<uint8_t> *)p_self)->~PoolVector(); } @@ -218,6 +223,11 @@ godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self) { return self->size(); } +godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self) { + const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self) { ((PoolVector<godot_int> *)p_self)->~PoolVector(); } @@ -307,6 +317,11 @@ godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self) return self->size(); } +godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self) { + const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self) { ((PoolVector<godot_real> *)p_self)->~PoolVector(); } @@ -404,6 +419,11 @@ godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_se return self->size(); } +godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self) { + const PoolVector<String> *self = (const PoolVector<String> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self) { ((PoolVector<String> *)p_self)->~PoolVector(); } @@ -500,6 +520,11 @@ godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_ return self->size(); } +godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self) { + const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self) { ((PoolVector<Vector2> *)p_self)->~PoolVector(); } @@ -596,6 +621,11 @@ godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_ return self->size(); } +godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self) { + const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self) { ((PoolVector<Vector3> *)p_self)->~PoolVector(); } @@ -692,6 +722,11 @@ godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self return self->size(); } +godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self) { + const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) { ((PoolVector<Color> *)p_self)->~PoolVector(); } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 55ba4ecc1e..2f304ca49c 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -1717,6 +1717,13 @@ ] }, { + "name": "godot_pool_byte_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_byte_array *", "p_self"] + ] + }, + { "name": "godot_pool_byte_array_destroy", "return_type": "void", "arguments": [ @@ -1841,6 +1848,13 @@ ] }, { + "name": "godot_pool_int_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_int_array *", "p_self"] + ] + }, + { "name": "godot_pool_int_array_destroy", "return_type": "void", "arguments": [ @@ -1965,6 +1979,13 @@ ] }, { + "name": "godot_pool_real_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_real_array *", "p_self"] + ] + }, + { "name": "godot_pool_real_array_destroy", "return_type": "void", "arguments": [ @@ -2089,6 +2110,13 @@ ] }, { + "name": "godot_pool_string_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_string_array *", "p_self"] + ] + }, + { "name": "godot_pool_string_array_destroy", "return_type": "void", "arguments": [ @@ -2213,6 +2241,13 @@ ] }, { + "name": "godot_pool_vector2_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_vector2_array *", "p_self"] + ] + }, + { "name": "godot_pool_vector2_array_destroy", "return_type": "void", "arguments": [ @@ -2337,6 +2372,13 @@ ] }, { + "name": "godot_pool_vector3_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_vector3_array *", "p_self"] + ] + }, + { "name": "godot_pool_vector3_array_destroy", "return_type": "void", "arguments": [ @@ -2461,6 +2503,13 @@ ] }, { + "name": "godot_pool_color_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_color_array *", "p_self"] + ] + }, + { "name": "godot_pool_color_array_destroy", "return_type": "void", "arguments": [ diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 96730ab085..63e8267f0e 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -191,6 +191,8 @@ uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, con godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self); +godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self); + void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self); // int @@ -222,6 +224,8 @@ godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, con godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self); +godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self); + void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self); // real @@ -253,6 +257,8 @@ godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self); +godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self); + void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self); // string @@ -284,6 +290,8 @@ godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_ godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self); +godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self); + void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self); // vector2 @@ -315,6 +323,8 @@ godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self); +godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self); + void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self); // vector3 @@ -346,6 +356,8 @@ godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self); +godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self); + void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self); // color @@ -377,6 +389,8 @@ godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_sel godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self); +godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self); + void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self); // diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index db7f8d22e6..edb296437b 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -199,7 +199,7 @@ StringName GDScript::get_instance_base_type() const { if (native.is_valid()) return native->get_name(); - if (base.is_valid()) + if (base.is_valid() && base->is_valid()) return base->get_instance_base_type(); return StringName(); } @@ -486,7 +486,7 @@ bool GDScript::_update_exports() { placeholder_fallback_enabled = false; - if (base_cache.is_valid()) { + if (base_cache.is_valid() && base_cache->is_valid()) { if (base_cache->_update_exports()) { changed = true; } diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 83d02e4977..d8816726ce 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -1561,14 +1561,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a //error // function, file, line, error, explanation String err_file; - if (p_instance && p_instance->script->is_valid() && p_instance->script->path != "") + if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->path != "") err_file = p_instance->script->path; else if (script) err_file = script->path; if (err_file == "") err_file = "<built-in>"; String err_func = name; - if (p_instance && p_instance->script->is_valid() && p_instance->script->name != "") + if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->name != "") err_func = p_instance->script->name + "." + err_func; int err_line = line; if (err_text == "") { diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index ca0d77f047..0db771f7c0 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -4221,7 +4221,7 @@ void VisualScriptEditor::_menu_option(int p_what) { if (nd.is_valid() && nd->has_input_sequence_port()) start_node = nodes.front()->key(); else { - EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port.")); + EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port.")); return; } } else { @@ -4252,7 +4252,7 @@ void VisualScriptEditor::_menu_option(int p_what) { if (nd.is_valid() && nd->has_input_sequence_port()) start_node = top_nd; else { - EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port.")); + EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port.")); return; } } else { |