summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-03-05 11:50:13 -0600
committerGitHub <noreply@github.com>2024-03-05 11:50:13 -0600
commitcc1217a43cab5ff8377c2f5e53301fda67def95e (patch)
tree22d1035491bf81b89c29d3a3ed111ffa2f743c44 /include/godot_cpp
parentf444616553e1fe1d78f4129a287e812256faffd2 (diff)
parent23c010900c9a09c5c99bfbb0d465cd468aa74b6c (diff)
downloadredot-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.hpp9
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); \
} \
} \
\