Fix some issues with weapons in automated designs.

This commit is contained in:
Ottermandias 2023-09-30 23:29:41 +02:00
parent c195f90706
commit ea55d9cb03

View file

@ -339,17 +339,17 @@ public class AutoDesignApplier : IDisposable
var checkState = !respectManual || state[EquipSlot.MainHand, false] is not StateChanged.Source.Manual; var checkState = !respectManual || state[EquipSlot.MainHand, false] is not StateChanged.Source.Manual;
if (checkUnlock && checkState) if (checkUnlock && checkState)
{ {
if (state.ModelData.Item(EquipSlot.MainHand).Type == item.Type) if (fromJobChange)
{
_state.ChangeItem(state, EquipSlot.MainHand, item, source);
totalEquipFlags |= EquipFlag.Mainhand;
}
else if (fromJobChange)
{ {
_jobChangeMainhand = item; _jobChangeMainhand = item;
_jobChangeState = state; _jobChangeState = state;
totalEquipFlags |= EquipFlag.Mainhand; totalEquipFlags |= EquipFlag.Mainhand;
} }
else if (state.ModelData.Item(EquipSlot.MainHand).Type == item.Type)
{
_state.ChangeItem(state, EquipSlot.MainHand, item, source);
totalEquipFlags |= EquipFlag.Mainhand;
}
} }
} }
@ -360,16 +360,16 @@ public class AutoDesignApplier : IDisposable
var checkState = !respectManual || state[EquipSlot.OffHand, false] is not StateChanged.Source.Manual; var checkState = !respectManual || state[EquipSlot.OffHand, false] is not StateChanged.Source.Manual;
if (checkUnlock && checkState) if (checkUnlock && checkState)
{ {
if (state.ModelData.Item(EquipSlot.OffHand).Type == item.Type) if (fromJobChange)
{
_state.ChangeItem(state, EquipSlot.OffHand, item, source);
totalEquipFlags |= EquipFlag.Mainhand;
}
else if (fromJobChange)
{ {
_jobChangeOffhand = item; _jobChangeOffhand = item;
_jobChangeState = state; _jobChangeState = state;
totalEquipFlags |= EquipFlag.Mainhand; totalEquipFlags |= EquipFlag.Offhand;
}
else if (state.ModelData.Item(EquipSlot.OffHand).Type == item.Type)
{
_state.ChangeItem(state, EquipSlot.OffHand, item, source);
totalEquipFlags |= EquipFlag.Offhand;
} }
} }
} }