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

ModuleResourceConverter should reset its recipe after being activated #242

Open
JonnyOThan opened this issue May 5, 2023 · 0 comments
Open

Comments

@JonnyOThan
Copy link

JonnyOThan commented May 5, 2023

The stock ModuleResourceConverter has this annoying property:

public virtual ConversionRecipe Recipe => _recipe ?? (_recipe = LoadRecipe());

Which means that once this property has been accessed, the recipe will never change. This is why you must save/load after changing converter recipes with B9PS. If B9PS reset the _recipe field after configuring this module, it should fix that problem.

Note this originally came up because RasterPropMonitor was accessing the Recipe property before B9PS had a chance to change the module, so it would get stuck with the wrong recipe permanently even across save/load. I've changed RPM to no longer do that, but other mods might have similar behavior.

I think adding some code in here could handle this:

public IEnumerable<IPartModifier> CreatePartModifiers(Part part, PartModule parentModule, BaseEventDetails moduleDataChangedEventDetails)

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

No branches or pull requests

1 participant