X Tutup
Skip to content

Fix ancestry constructors#110805

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
lawnjelly:fix_ancestry_construct
Sep 23, 2025
Merged

Fix ancestry constructors#110805
akien-mga merged 1 commit intogodotengine:masterfrom
lawnjelly:fix_ancestry_construct

Conversation

@lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Sep 23, 2025

Some object constructors in 4.x were not initializing ancestry correctly for some types, this was producing casting failures.

Fixes regression introduced in #107868 and #110763.

Notes

  • The report mentions a 2D regression but I'm not seeing (immediately) how that can be occurring, it would be nice to have an MRP, I don't have many 4.x test projects. Either way this should fix 3D problems.
  • This is one gotcha for ancestry, if new constructors are added for these core node types that don't set the ancestry, the system will break. I'll see if there's a way we can make this more idiot - proof (me being the idiot in this case 😁 ).
  • These were probably late night copy-pasta bugs when forward porting that didn't show up until Use AncestralClass to speed up Object::cast_to when possible. #110763.

Some object constructors in 4.x were not initializing ancestry correctly for some types, this was producing casting failures.
@lawnjelly lawnjelly force-pushed the fix_ancestry_construct branch from 8bc23c7 to cbbc2ea Compare September 23, 2025 07:27
@lawnjelly lawnjelly marked this pull request as ready for review September 23, 2025 07:31
@lawnjelly lawnjelly requested review from a team as code owners September 23, 2025 07:31
Copy link
Member

@rburing rburing left a comment

Choose a reason for hiding this comment

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

I confirm this defines the ancestry in the constructor that is actually called, fixing the bug.

Edit: In the future we could add inheritance checks for the whole class hierarchy as a unit test.

@Ivorforce
Copy link
Member

Thanks for taking care of this quickly!

@akien-mga akien-mga merged commit 3d91a48 into godotengine:master Sep 23, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the fix_ancestry_construct branch September 23, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup