Skip to content

Fix _notification() with parent and child classes#1381

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:notification-hierarchy
Mar 5, 2024
Merged

Fix _notification() with parent and child classes#1381
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:notification-hierarchy

Conversation

@dsnopek

@dsnopek dsnopek commented Feb 2, 2024

Copy link
Copy Markdown
Collaborator

Currently, if you have a parent and child class both defined in GDExtension, and the child class has it's own _notification() method, the parent _notification() won't be called. But, also, godot-cpp is not respecting the p_reversed flag, and will always run reversed, calling the child before the parent.

This PR fixes that!

It also adds an automated test to ensure that it is working correctly, and so we won't break this again.

@dsnopek dsnopek added bug This has been identified as a bug cherrypick:4.1 cherrypick:4.2 labels Feb 2, 2024
@dsnopek dsnopek added this to the 4.x milestone Feb 2, 2024
@dsnopek
dsnopek requested a review from a team as a code owner February 2, 2024 16:13
@dsnopek
dsnopek force-pushed the notification-hierarchy branch from d213d6f to 23c0109 Compare February 22, 2024 20:46

@AThousandShips AThousandShips left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, matches the way it works in the engine

@dsnopek
dsnopek merged commit cc1217a into godotengine:master Mar 5, 2024
@dsnopek

dsnopek commented Mar 11, 2024

Copy link
Copy Markdown
Collaborator Author

Cherry-picked for 4.2 in PR #1410

@dsnopek

dsnopek commented Mar 11, 2024

Copy link
Copy Markdown
Collaborator Author

Cherry-picked for 4.1 in PR #1411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants