summaryrefslogtreecommitdiff
path: root/modules/gdnative/gdnative.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdnative/gdnative.cpp')
-rw-r--r--modules/gdnative/gdnative.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 348d8533ad..214164ef89 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -29,11 +29,11 @@
/*************************************************************************/
#include "gdnative.h"
-#include "global_config.h"
#include "global_constants.h"
#include "io/file_access_encrypted.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/scene_tree.h"
#include "scene/resources/scene_format_text.h"
@@ -573,7 +573,7 @@ Error GDNativeLibrary::_initialize() {
}
ERR_FAIL_COND_V(platform_file == "", ERR_DOES_NOT_EXIST);
- StringName path = GlobalConfig::get_singleton()->globalize_path(platform_file);
+ StringName path = ProjectSettings::get_singleton()->globalize_path(platform_file);
GDNativeLibrary::currently_initialized_library = this;
@@ -876,9 +876,12 @@ bool GDNativeInstance::get(const StringName &p_name, Variant &r_ret) const {
const Variant *args[1] = { &name };
godot_variant result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 1, (godot_variant **)args);
- r_ret = *(Variant *)&result;
+ if (((Variant *)&result)->get_type() != Variant::NIL) {
+ r_ret = *(Variant *)&result;
+ godot_variant_destroy(&result);
+ return true;
+ }
godot_variant_destroy(&result);
- return true;
}
return false;
@@ -1083,7 +1086,7 @@ void GDNativeScriptLanguage::init() {
// TODO: Expose globals
GLOBAL_DEF("gdnative/default_gdnativelibrary", "");
PropertyInfo prop_info(Variant::STRING, "gdnative/default_gdnativelibrary", PROPERTY_HINT_FILE, "tres,res,dllib");
- GlobalConfig::get_singleton()->set_custom_property_info("gdnative/default_gdnativelibrary", prop_info);
+ ProjectSettings::get_singleton()->set_custom_property_info("gdnative/default_gdnativelibrary", prop_info);
// generate bindings
#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)