Fix _notification with parent and child classes

This commit is contained in:
David Snopek
2024-02-02 10:07:45 -06:00
parent f90085917b
commit 23c010900c
6 changed files with 62 additions and 2 deletions

View File

@@ -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<m_class *>(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); \
} \
} \
\