Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] let modules interact with each other during onDestroy #3131

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

cyn0x8
Copy link
Contributor

@cyn0x8 cyn0x8 commented Sep 5, 2024

Briefly describe the issue(s) fixed.

currently, interaction between modules in onDestroy is unreliable as they are currently removed from the module list as they are iterated through instead of after

the module priority currently cannot be used to fix this since map iteration is unordered

i have a use case right now where id like to retrieve a value in a module from another module (a bool used to conditionally manage a set of sprites), but trying to retrieve the value will randomly error because ModuleHandler will attempt to grab the module after it has been removed from the cache

while in this case i can make a workaround by setting a variable to that bool before the reload starts, there arent any workarounds for functions....

this pr simply just removes that removal during the iteration (clear() functionally does the same thing anyways)

@cyn0x8 cyn0x8 changed the title [ENHANCEMENT] let modules interact with each other before destroyed [ENHANCEMENT] let modules interact with each other during onDestroy Sep 5, 2024
@EliteMasterEric EliteMasterEric added the status: pending triage The bug or PR has not been reviewed yet. label Sep 8, 2024
@EliteMasterEric
Copy link
Member

(clear() functionally does the same thing anyways)

👍

@EliteMasterEric EliteMasterEric added type: minor bug Involves a minor bug or issue. mods Issue is related to the use of mods. status: accepted Approved for contribution. If it's not already merged, it may be merged on a private branch. and removed status: pending triage The bug or PR has not been reviewed yet. labels Sep 25, 2024
@EliteMasterEric EliteMasterEric added this to the 0.5.1 milestone Sep 25, 2024
@ninjamuffin99 ninjamuffin99 merged commit cb16a8d into FunkinCrew:develop Sep 30, 2024
@cyn0x8 cyn0x8 deleted the patch-2 branch October 10, 2024 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mods Issue is related to the use of mods. status: accepted Approved for contribution. If it's not already merged, it may be merged on a private branch. type: minor bug Involves a minor bug or issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants