From 8e077b16f4eb4e036760fae586c63b2a43b2eff7 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Mon, 11 Sep 2023 16:57:22 +0200 Subject: [PATCH] Fix some bugs with respecting manual weapon changes. --- Glamourer/Automation/AutoDesignApplier.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Glamourer/Automation/AutoDesignApplier.cs b/Glamourer/Automation/AutoDesignApplier.cs index ec362ae..79ddec0 100644 --- a/Glamourer/Automation/AutoDesignApplier.cs +++ b/Glamourer/Automation/AutoDesignApplier.cs @@ -316,10 +316,10 @@ public class AutoDesignApplier : IDisposable if (equipFlags.HasFlag(EquipFlag.Mainhand)) { - var item = design.Item(EquipSlot.MainHand); - if (!_config.UnlockedItemMode - || _itemUnlocks.IsUnlocked(item.Id, out _) && !respectManual - || state[EquipSlot.MainHand, false] is not StateChanged.Source.Manual) + var item = design.Item(EquipSlot.MainHand); + var checkUnlock = !_config.UnlockedItemMode || _itemUnlocks.IsUnlocked(item.Id, out _); + var checkState = !respectManual || state[EquipSlot.MainHand, false] is not StateChanged.Source.Manual; + if (checkUnlock && checkState) { if (state.ModelData.Item(EquipSlot.MainHand).Type == item.Type) { @@ -337,10 +337,10 @@ public class AutoDesignApplier : IDisposable if (equipFlags.HasFlag(EquipFlag.Offhand)) { - var item = design.Item(EquipSlot.OffHand); - if (!_config.UnlockedItemMode - || _itemUnlocks.IsUnlocked(item.Id, out _) && !respectManual - || state[EquipSlot.OffHand, false] is not StateChanged.Source.Manual) + var item = design.Item(EquipSlot.OffHand); + var checkUnlock = !_config.UnlockedItemMode || _itemUnlocks.IsUnlocked(item.Id, out _); + var checkState = !respectManual || state[EquipSlot.OffHand, false] is not StateChanged.Source.Manual; + if (checkUnlock && checkState) { if (state.ModelData.Item(EquipSlot.OffHand).Type == item.Type) {