summaryrefslogtreecommitdiffstats
path: root/core/extension
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-04-25 07:37:38 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-04-25 08:20:22 -0500
commit45463f75d6a1a38c104481b8d6b38e682e4c9d3f (patch)
tree53d9f4f4ca76b955969d84936d5d877eb2500fd6 /core/extension
parent780e1a50408360cf0cf93c0b55b59e9d7b4ad0b1 (diff)
downloadredot-engine-45463f75d6a1a38c104481b8d6b38e682e4c9d3f.tar.gz
Fix ptrcalls to static GDExtension methods
Diffstat (limited to 'core/extension')
-rw-r--r--core/extension/gdextension.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp
index 3ea5791282..22a5df9935 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<GDExtensionConstTypePtr *>(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<GDExtensionConstTypePtr *>(p_args), (GDExtensionTypePtr)r_ret);
}