From c4705a590b5eb01d63afb907d6dad5c49d8f6fe1 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sat, 24 Jun 2023 03:07:22 +0200 Subject: Fix Object::notification order Previously the `p_reversed` parameter didn't influence the order in a correct way. Also script overridden _notification functions were not called in the correct order. To fix this some `notification` functions had to add a `p_reversed` parameter. This made it necessary to adjust cpp-bindings. Co-authored-by: David Snopek --- modules/mono/csharp_script.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/mono/csharp_script.cpp') diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 1fcb2791d9..692eb2dc6a 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1978,7 +1978,7 @@ const Variant CSharpInstance::get_rpc_config() const { return script->get_rpc_config(); } -void CSharpInstance::notification(int p_notification) { +void CSharpInstance::notification(int p_notification, bool p_reversed) { if (p_notification == Object::NOTIFICATION_PREDELETE) { // When NOTIFICATION_PREDELETE is sent, we also take the chance to call Dispose(). // It's safe to call Dispose() multiple times and NOTIFICATION_PREDELETE is guaranteed @@ -1996,7 +1996,7 @@ void CSharpInstance::notification(int p_notification) { return; } - _call_notification(p_notification); + _call_notification(p_notification, p_reversed); GDMonoCache::managed_callbacks.CSharpInstanceBridge_CallDispose( gchandle.get_intptr(), /* okIfNull */ false); @@ -2004,10 +2004,10 @@ void CSharpInstance::notification(int p_notification) { return; } - _call_notification(p_notification); + _call_notification(p_notification, p_reversed); } -void CSharpInstance::_call_notification(int p_notification) { +void CSharpInstance::_call_notification(int p_notification, bool p_reversed) { Variant arg = p_notification; const Variant *args[1] = { &arg }; StringName method_name = SNAME("_notification"); -- cgit v1.2.3