From 4c33c60500d9452922f8bda00c3470acc3903712 Mon Sep 17 00:00:00 2001 From: anrp Date: Wed, 18 Oct 2023 17:05:21 -0400 Subject: [PATCH] Allow coexistance of GDScript and GDExtension virtual methods in the same object Resolves https://github.com/godotengine/godot-cpp/issues/1224 --- core/object/make_virtuals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index 0f3cf3916a9..79a8df6c8af 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;\\