Skip to content

[BUGFIX/ADJUSTMENT] Fix improper Scripted superclass redirection - #512

Merged
AbnormalPoof merged 4 commits into
FunkinCrew:developfrom
nykwono:super-constructor-overrides
Sep 24, 2026
Merged

AbnormalPoof merged 4 commits into
FunkinCrew:developfrom
nykwono:super-constructor-overrides

Conversation

@nykwono

@nykwono nykwono commented Sep 21, 2026 •

Copy link
Copy Markdown

This PR fixes an issue where if you have a scripted class that extends another, if you call the constructor of it then it will not use the overwritten functions of it and instead the original superclass'.

This happens because the topASC property is only set for the scripted class AFTER the constructor is called and the superclass are initialized, allowing for no redirection to happen.

I fixed this by simply making sure superclasses are initialized AS the scripted class is, and making sure the constructor functions are only called when needed and not when PolymodScriptClass is initialized. There was a bit of reworking to topASC needed to fix this but nonetheless.

Small other bugfixes included in this:

  • You can instantiate native classes through their full package name now (this still checks for blacklists thanks to resolveDottedPath
  • Some small refactoring relating to topASC to make sure it ALWAYS checks for overwritten fields from within scripted superclasses (since before it would ONLY check for the topASC and not any child classes)

createSuperClass(args);
_superConstructorCalled = true;

// This class doesn't have a custom constructor, so we the superclasses constructor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This class doesn't have a custom constructor, so we the superclasses constructor.
// This class doesn't have a custom constructor, so we use the superclasses constructor.

We are SuperClass constructor

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

MF..... ur right

@nykwono
nykwono force-pushed the super-constructor-overrides branch from af03e11 to df386d9 Compare September 22, 2026 06:15
@AbnormalPoof
AbnormalPoof merged commit 8db9f26 into FunkinCrew:develop Sep 24, 2026
9 checks passed
@nykwono
nykwono deleted the super-constructor-overrides branch September 24, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants