mipen/ModLib

ModLib needlessly creates a new instance of the mod's settings class when GetSettings is called

bm01 opened this issue · 0 comments

bm01 commented

In ModLib.Definitions/SettingsDatabase.cs, an instance is created but is only used if the dictionary doesn't contain one already. While the ID property of that instance is indeed accessed further down the code, why not letting the mod pass it as an argument instead? Not only that ID might no longer be valid (unlikely, but still), but mods may rely on their settings class constructor to do some stuff and calling it more than necessary should be avoided. In fact, Letting the mod instantiate their settings class and pass the instance down to ModLib was probably a better approach.