diff options
author | David Snopek <dsnopek@gmail.com> | 2024-03-05 11:50:13 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 11:50:13 -0600 |
commit | cc1217a43cab5ff8377c2f5e53301fda67def95e (patch) | |
tree | 22d1035491bf81b89c29d3a3ed111ffa2f743c44 /include/godot_cpp | |
parent | f444616553e1fe1d78f4129a287e812256faffd2 (diff) | |
parent | 23c010900c9a09c5c99bfbb0d465cd468aa74b6c (diff) | |
download | redot-cpp-cc1217a43cab5ff8377c2f5e53301fda67def95e.tar.gz |
Merge pull request #1381 from dsnopek/notification-hierarchy
Fix `_notification()` with parent and child classes
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<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); \ } \ } \ \ |