summaryrefslogtreecommitdiff
path: root/core/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/object.cpp')
-rw-r--r--core/object.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 928e9bb978..5e6c809f7a 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -654,7 +654,7 @@ void Object::call_multilevel(const StringName &p_method, const Variant **p_args,
if (p_method == CoreStringNames::get_singleton()->_free) {
#ifdef DEBUG_ENABLED
- if (cast_to<Reference>()) {
+ if (Object::cast_to<Reference>(this)) {
ERR_EXPLAIN("Can't 'free' a reference.");
ERR_FAIL();
return;
@@ -900,7 +900,7 @@ Variant Object::call(const StringName &p_method, const Variant **p_args, int p_a
r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
return Variant();
}
- if (cast_to<Reference>()) {
+ if (Object::cast_to<Reference>(this)) {
r_error.argument = 0;
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
ERR_EXPLAIN("Can't 'free' a reference.");