summaryrefslogtreecommitdiff
path: root/core/class_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/class_db.cpp')
-rw-r--r--core/class_db.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index a2941d70f6..35e216a58f 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -1033,7 +1033,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
return true; //return true but do nothing
}
- Variant::CallError ce;
+ Callable::CallError ce;
if (psg->index >= 0) {
Variant index = psg->index;
@@ -1055,7 +1055,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
}
if (r_valid)
- *r_valid = ce.error == Variant::CallError::CALL_OK;
+ *r_valid = ce.error == Callable::CallError::CALL_OK;
return true;
}
@@ -1078,12 +1078,12 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
if (psg->index >= 0) {
Variant index = psg->index;
const Variant *arg[1] = { &index };
- Variant::CallError ce;
+ Callable::CallError ce;
r_value = p_object->call(psg->getter, arg, 1, ce);
} else {
- Variant::CallError ce;
+ Callable::CallError ce;
if (psg->_getptr) {
r_value = psg->_getptr->call(p_object, NULL, 0, ce);
@@ -1094,13 +1094,23 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
return true;
}
- const int *c = check->constant_map.getptr(p_property);
+ const int *c = check->constant_map.getptr(p_property); //constants count
if (c) {
r_value = *c;
return true;
}
+ if (check->method_map.has(p_property)) { //methods count
+ r_value = Callable(p_object, p_property);
+ return true;
+ }
+
+ if (check->signal_map.has(p_property)) { //signals count
+ r_value = Signal(p_object, p_property);
+ return true;
+ }
+
check = check->inherits_ptr;
}