using ACE.Shared.Mods; namespace CustomClothingBase; public class Mod : BasicMod { public Mod() : base() => Setup(nameof(CustomClothingBase), new PatchClass(this)); // Aelrynth (2026-09-30): ACE.Shared's BasicMod.Stop calls ModManager.DisableModByPath from its // catch, and disabling calls Stop again - any exception while shutting down recursed until the // process died of a stack overflow (staging, 14:02:41, `mod disable CustomClothingBase`: the // patch's Stop threw on null Settings). Here each piece shuts down on its own, a failure is // logged, and nothing calls back into disable. public override void Stop() { foreach (var patch in Patches ?? new()) { try { patch?.Dispose(); } catch (Exception ex) { ModManager.Log($"{Name}: stopping {patch?.GetType().Name} failed: {ex.Message}", ModManager.LogLevel.Error); } } try { Harmony?.UnpatchAll(ID); } catch (Exception ex) { ModManager.Log($"{Name}: unpatching failed: {ex.Message}", ModManager.LogLevel.Error); } } }