Skip to content

Commit

Permalink
feat: Make sure Settings are initialized on startup (#100)
Browse files Browse the repository at this point in the history
Forces initialization of Settings on startup.
  • Loading branch information
krafs authored Oct 23, 2022
1 parent 9fb4f90 commit f68f70c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ static Patcher()
var skillRecordLearnMethod = AccessTools.Method(typeof(SkillRecord), nameof(SkillRecord.Learn));
var skillRecordLearnTranspilerMethod = AccessTools.Method(typeof(Patcher), nameof(LearnTranspilerPatch));

// Force initialize Settings to make sure profile is set up.
_ = LoadedModManager.GetMod<LevelUpMod>().GetSettings<Settings>().Profile;

new Harmony("Krafs.LevelUp").Patch(skillRecordLearnMethod, transpiler: new HarmonyMethod(skillRecordLearnTranspilerMethod));
}

Expand Down

0 comments on commit f68f70c

Please sign in to comment.