Skip to content

ModuleResourceConverter should reset its recipe after being activated #10

@JonnyOThan

Description

@JonnyOThan

copied from blowfishpro#242

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: https://github.com/blowfishpro/B9PartSwitch/blob/dd7482a87deb750690ac0d77860b3d02460b698a/B9PartSwitch/PartSwitch/ModuleModifierInfo.cs#L86

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions