diff --git a/BTD Mod Helper Core/Api/ModOptions/ModSettingsHandler.cs b/BTD Mod Helper Core/Api/ModOptions/ModSettingsHandler.cs index f0fafbfa4..1af107587 100644 --- a/BTD Mod Helper Core/Api/ModOptions/ModSettingsHandler.cs +++ b/BTD Mod Helper Core/Api/ModOptions/ModSettingsHandler.cs @@ -120,7 +120,7 @@ internal static void SaveModSettings(string modSettingsDir) { foreach (var mod in MelonHandler.Mods.OfType()) { - if (!mod.ModSettings.Any()) continue; + if (mod.ModSettings == null || !mod.ModSettings.Any()) continue; SaveModSettings(mod, modSettingsDir); } } diff --git a/BTD Mod Helper Core/ModHelperData.cs b/BTD Mod Helper Core/ModHelperData.cs index 0db5f2b51..a3d4777e5 100644 --- a/BTD Mod Helper Core/ModHelperData.cs +++ b/BTD Mod Helper Core/ModHelperData.cs @@ -2,6 +2,6 @@ { public static class ModHelperData { - public const string currentVersion = "2.4.8"; + public const string currentVersion = "2.4.9"; } } diff --git a/BloonsTD6 Mod Helper/Patches/UI/TowerSelectionMenu_UpgradeTower.cs b/BloonsTD6 Mod Helper/Patches/UI/TowerSelectionMenu_UpgradeTower.cs index e14f236c8..fee96a519 100644 --- a/BloonsTD6 Mod Helper/Patches/UI/TowerSelectionMenu_UpgradeTower.cs +++ b/BloonsTD6 Mod Helper/Patches/UI/TowerSelectionMenu_UpgradeTower.cs @@ -1,5 +1,4 @@ -using Assets.Scripts.Models.Towers.Upgrades; -using Assets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu; +using Assets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu; using HarmonyLib; namespace BTD_Mod_Helper.Patches.UI @@ -7,13 +6,13 @@ namespace BTD_Mod_Helper.Patches.UI /// /// This is a benign patch that helps fix unexpected issues with changing upgrade restrictions /// - [HarmonyPatch(typeof(TowerSelectionMenu), nameof(TowerSelectionMenu.UpgradeTower), typeof(UpgradeModel), typeof(int), typeof(float))] + [HarmonyPatch(typeof(TowerSelectionMenu), nameof(TowerSelectionMenu.TowerUpgraded))] internal class TowerSelectionMenu_UpgradeTower { [HarmonyPostfix] internal static void Postfix(TowerSelectionMenu __instance) { - __instance.InitUpgradeButtons(); + __instance.triggerUiUpdate = true; } } } \ No newline at end of file