From 23c010900c9a09c5c99bfbb0d465cd468aa74b6c Mon Sep 17 00:00:00 2001 From: David Snopek Date: Fri, 2 Feb 2024 10:07:45 -0600 Subject: Fix _notification with parent and child classes --- include/godot_cpp/classes/wrapped.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/godot_cpp') diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 25a93df..fba855d 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -239,11 +239,16 @@ public: \ static void notification_bind(GDExtensionClassInstancePtr p_instance, int32_t p_what, GDExtensionBool p_reversed) { \ if (p_instance && m_class::_get_notification()) { \ + if (!p_reversed) { \ + m_inherits::notification_bind(p_instance, p_what, p_reversed); \ + } \ if (m_class::_get_notification() != m_inherits::_get_notification()) { \ m_class *cls = reinterpret_cast(p_instance); \ - return cls->_notification(p_what); \ + cls->_notification(p_what); \ + } \ + if (p_reversed) { \ + m_inherits::notification_bind(p_instance, p_what, p_reversed); \ } \ - m_inherits::notification_bind(p_instance, p_what, p_reversed); \ } \ } \ \ -- cgit v1.2.3