summaryrefslogtreecommitdiffstats
path: root/core/object/object.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-08-30 08:44:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-08-30 08:44:36 +0200
commit8edc0b43b94bcc04defeeebd7ce120a0131ff511 (patch)
treebfa167f5598efc3f8c0a05b131be6bb8812b7edd /core/object/object.cpp
parentd2f76e87869b892d7992696e0b381c5afebe3d0d (diff)
parentc4705a590b5eb01d63afb907d6dad5c49d8f6fe1 (diff)
downloadredot-engine-8edc0b43b94bcc04defeeebd7ce120a0131ff511.tar.gz
Merge pull request #78634 from Sauermann/fix-notification-order
Fix `Object::notification` order
Diffstat (limited to 'core/object/object.cpp')
-rw-r--r--core/object/object.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index b803d57cd9..39f20a212f 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -799,14 +799,30 @@ Variant Object::call_const(const StringName &p_method, const Variant **p_args, i
}
void Object::notification(int p_notification, bool p_reversed) {
- _notificationv(p_notification, p_reversed);
+ if (p_reversed) {
+ if (script_instance) {
+ script_instance->notification(p_notification, p_reversed);
+ }
+ } else {
+ _notificationv(p_notification, p_reversed);
+ }
- if (script_instance) {
- script_instance->notification(p_notification);
+ if (_extension) {
+ if (_extension->notification2) {
+ _extension->notification2(_extension_instance, p_notification, p_reversed);
+#ifndef DISABLE_DEPRECATED
+ } else if (_extension->notification) {
+ _extension->notification(_extension_instance, p_notification);
+#endif // DISABLE_DEPRECATED
+ }
}
- if (_extension && _extension->notification) {
- _extension->notification(_extension_instance, p_notification);
+ if (p_reversed) {
+ _notificationv(p_notification, p_reversed);
+ } else {
+ if (script_instance) {
+ script_instance->notification(p_notification, p_reversed);
+ }
}
}