From 45463f75d6a1a38c104481b8d6b38e682e4c9d3f Mon Sep 17 00:00:00 2001 From: David Snopek Date: Thu, 25 Apr 2024 07:37:38 -0500 Subject: [PATCH] Fix ptrcalls to static GDExtension methods --- core/extension/gdextension.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index 3ea5791282e..22a5df9935b 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -275,7 +275,7 @@ public: ret_opaque = r_ret->get_type() == Variant::NIL ? r_ret : VariantInternal::get_opaque_pointer(r_ret); } - ptrcall(p_object, argptrs, ret_opaque); + ptrcall_func(method_userdata, extension_instance, reinterpret_cast(argptrs), (GDExtensionTypePtr)ret_opaque); if (r_ret && r_ret->get_type() == Variant::OBJECT) { VariantInternal::update_object_id(r_ret); @@ -289,7 +289,7 @@ public: ERR_FAIL_COND_MSG(p_object && p_object->is_extension_placeholder(), vformat("Cannot call GDExtension method bind '%s' on placeholder instance.", name)); #endif ERR_FAIL_COND_MSG(vararg, "Vararg methods don't have ptrcall support. This is most likely an engine bug."); - GDExtensionClassInstancePtr extension_instance = p_object->_get_extension_instance(); + GDExtensionClassInstancePtr extension_instance = is_static() ? nullptr : p_object->_get_extension_instance(); ptrcall_func(method_userdata, extension_instance, reinterpret_cast(p_args), (GDExtensionTypePtr)r_ret); }