summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-04-28 22:49:10 +0200
committerreduz <reduzio@gmail.com>2022-05-03 17:08:09 +0200
commit0a57f964a357976e023b638e872397ba94123776 (patch)
tree73b2d68b63b7634857150b6a31ae281b27cb392f /core/object
parentd5d86cb26e65b89a00b644de6eef510d8ca06797 (diff)
Implement missing Node & Resource placeholders
Implemented by request of @neikeq to advance in the GDExtension version of Mono. * If a Resource type is missing upon load, it will be remembered together with its data (Unless manually overriden). * If a Node type is missing upon load, it will be also be remembered together with its data (unless deleted). This feature makes working with GDExtension much easier, as it ensures that missing types no longer cause data loss.
Diffstat (limited to 'core/object')
-rw-r--r--core/object/object.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 1defd85a14..2b62041533 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -434,15 +434,6 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
}
}
- // Something inside the object... :|
- bool success = _setv(p_name, p_value);
- if (success) {
- if (r_valid) {
- *r_valid = true;
- }
- return;
- }
-
#ifdef TOOLS_ENABLED
if (script_instance) {
bool valid;
@@ -456,6 +447,15 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
}
#endif
+ // Something inside the object... :|
+ bool success = _setv(p_name, p_value);
+ if (success) {
+ if (r_valid) {
+ *r_valid = true;
+ }
+ return;
+ }
+
if (r_valid) {
*r_valid = false;
}
@@ -518,15 +518,6 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
return ret;
} else {
- // Something inside the object... :|
- bool success = _getv(p_name, ret);
- if (success) {
- if (r_valid) {
- *r_valid = true;
- }
- return ret;
- }
-
#ifdef TOOLS_ENABLED
if (script_instance) {
bool valid;
@@ -539,6 +530,14 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
}
}
#endif
+ // Something inside the object... :|
+ bool success = _getv(p_name, ret);
+ if (success) {
+ if (r_valid) {
+ *r_valid = true;
+ }
+ return ret;
+ }
if (r_valid) {
*r_valid = false;