Skip to content

prevent ParticleType instances from being kept alive forever#1113

Open
earthwise01 wants to merge 1 commit into
EverestAPI:devfrom
earthwise01:obsolete-particletype-alltypes
Open

prevent ParticleType instances from being kept alive forever#1113
earthwise01 wants to merge 1 commit into
EverestAPI:devfrom
earthwise01:obsolete-particletype-alltypes

Conversation

@earthwise01

Copy link
Copy Markdown

Currently, the constructors for Monocle.ParticleType add all created instances to a private static AllTypes list, which is never used anywhere else. While this is fine in vanilla, this causes minor issues for mods which create new ParticleTypes on the fly (e.g. to allow customization through EntityData, etc), as all created instances will be kept alive forever.

This PR fixes this by removing the AllTypes.Add(this) calls from both constructors, and also applies an [Obsolete] attribute to the list itself.

@maddie480-bot maddie480-bot added the 1: review needed This PR needs 2 approvals to be merged (bot-managed) label Apr 29, 2026

@microlith57 microlith57 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.

cool

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

Labels

1: review needed This PR needs 2 approvals to be merged (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants