From b0a33cac7c9c46e80979d1a507305cf71b3f6a40 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Sun, 22 Oct 2023 17:20:49 -0500 Subject: [PATCH] GDExtension: Use ObjectID when creating custom callable --- core/extension/gdextension_interface.cpp | 4 +--- core/extension/gdextension_interface.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index d1b4e6a30f2..e02e7aa701f 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -159,9 +159,7 @@ public: userdata = p_info->callable_userdata; token = p_info->token; - if (p_info->object != nullptr) { - object = ((Object *)p_info->object)->get_instance_id(); - } + object = p_info->object_id; call_func = p_info->call_func; is_valid_func = p_info->is_valid_func; diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index 240da6e0738..d58f0226d81 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -392,7 +392,7 @@ typedef GDExtensionBool (*GDExtensionCallableCustomLessThan)(void *callable_user typedef void (*GDExtensionCallableCustomToString)(void *callable_userdata, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out); typedef struct { - /* Only `call_func` and `token` are strictly required, however, `object` should be passed if its not a static method. + /* Only `call_func` and `token` are strictly required, however, `object_id` should be passed if its not a static method. * * `token` should point to an address that uniquely identifies the GDExtension (for example, the * `GDExtensionClassLibraryPtr` passed to the entry symbol function. @@ -409,7 +409,7 @@ typedef struct { void *callable_userdata; void *token; - GDExtensionObjectPtr object; + GDObjectInstanceID object_id; GDExtensionCallableCustomCall call_func; GDExtensionCallableCustomIsValid is_valid_func;