From ec0f7a2d1e7e1124656db3ae7daf25119c096573 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Wed, 7 Feb 2024 02:56:06 +0100 Subject: [PATCH] Fix revert design base state. --- Glamourer/Automation/AutoDesignApplier.cs | 6 +++--- Glamourer/State/StateEditor.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Glamourer/Automation/AutoDesignApplier.cs b/Glamourer/Automation/AutoDesignApplier.cs index 65116db..28e1111 100644 --- a/Glamourer/Automation/AutoDesignApplier.cs +++ b/Glamourer/Automation/AutoDesignApplier.cs @@ -79,7 +79,7 @@ public sealed class AutoDesignApplier : IDisposable { Glamourer.Log.Verbose( $"Changing Mainhand from {state.ModelData.Weapon(EquipSlot.MainHand)} | {state.BaseData.Weapon(EquipSlot.MainHand)} to {data.Item1} for 0x{actor.Address:X}."); - _state.ChangeItem(_jobChangeState, EquipSlot.MainHand, data.Item1, new ApplySettings(Source: data.Item2)); + _state.ChangeItem(state, EquipSlot.MainHand, data.Item1, new ApplySettings(Source: data.Item2)); weapon = state.ModelData.Weapon(EquipSlot.MainHand); } @@ -91,7 +91,7 @@ public sealed class AutoDesignApplier : IDisposable { Glamourer.Log.Verbose( $"Changing Offhand from {state.ModelData.Weapon(EquipSlot.OffHand)} | {state.BaseData.Weapon(EquipSlot.OffHand)} to {data.Item1} for 0x{actor.Address:X}."); - _state.ChangeItem(_jobChangeState, EquipSlot.OffHand, data.Item1, new ApplySettings(Source: data.Item2)); + _state.ChangeItem(state, EquipSlot.OffHand, data.Item1, new ApplySettings(Source: data.Item2)); weapon = state.ModelData.Weapon(EquipSlot.OffHand); } @@ -264,7 +264,7 @@ public sealed class AutoDesignApplier : IDisposable var mergedDesign = _designMerger.Merge( set.Designs.Where(d => d.IsActive(actor)).SelectMany(d => d.Design?.AllLinks.Select(l => (l.Design, l.Flags & d.Type)) ?? [(d.Design, d.Type)]), - state.ModelData, true, _config.AlwaysApplyAssociatedMods); + state.BaseData, true, _config.AlwaysApplyAssociatedMods); _state.ApplyDesign(state, mergedDesign, new ApplySettings(0, StateSource.Fixed, respectManual, fromJobChange, false)); } diff --git a/Glamourer/State/StateEditor.cs b/Glamourer/State/StateEditor.cs index 254c67e..219feab 100644 --- a/Glamourer/State/StateEditor.cs +++ b/Glamourer/State/StateEditor.cs @@ -321,7 +321,7 @@ public class StateEditor( public void ApplyDesign(object data, DesignBase design, ApplySettings settings) { var merged = settings.MergeLinks && design is Design d - ? merger.Merge(d.AllLinks, ((ActorState)data).ModelData, false, Config.AlwaysApplyAssociatedMods) + ? merger.Merge(d.AllLinks, ((ActorState)data).BaseData, false, Config.AlwaysApplyAssociatedMods) : new MergedDesign(design); ApplyDesign(data, merged, settings with