summaryrefslogtreecommitdiffstats
path: root/core/object/make_virtuals.py
diff options
context:
space:
mode:
authoranrp <anrp@anrp.net>2023-10-18 17:05:21 -0400
committeranrp <anrp@anrp.net>2023-10-19 10:21:26 -0400
commit4c33c60500d9452922f8bda00c3470acc3903712 (patch)
tree830d8c53498c77913ab6a75e75d6bb826a7704fd /core/object/make_virtuals.py
parent7f884b4e0017368e193d96f425aac6c2d8a86eb0 (diff)
downloadredot-engine-4c33c60500d9452922f8bda00c3470acc3903712.tar.gz
Allow coexistance of GDScript and GDExtension virtual methods in the same object
Resolves https://github.com/godotengine/godot-cpp/issues/1224
Diffstat (limited to 'core/object/make_virtuals.py')
-rw-r--r--core/object/make_virtuals.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py
index 0f3cf3916a..79a8df6c8a 100644
--- a/core/object/make_virtuals.py
+++ b/core/object/make_virtuals.py
@@ -47,8 +47,8 @@ _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\
}\\
_FORCE_INLINE_ bool _gdvirtual_##m_name##_overridden() const { \\
ScriptInstance *_script_instance = ((Object*)(this))->get_script_instance();\\
- if (_script_instance) {\\
- return _script_instance->has_method(_gdvirtual_##m_name##_sn);\\
+ if (_script_instance && _script_instance->has_method(_gdvirtual_##m_name##_sn)) {\\
+ return true;\\
}\\
if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\
_gdvirtual_##m_name = nullptr;\\