Core/Player: prevent early aura removal when swapping weapons

This commit is contained in:
hondacrx
2018-03-12 14:46:20 -04:00
parent b9c1e3876b
commit 05c975c643
+10 -3
View File
@@ -1945,7 +1945,7 @@ namespace Game.Entities
if (pProto != null && pProto.GetItemSet() != 0)
Item.RemoveItemsSetItem(this, pProto);
_ApplyItemMods(pItem, slot, false);
_ApplyItemMods(pItem, slot, false, update);
// remove item dependent auras and casts (only weapon and armor slots)
if (slot < EquipmentSlot.End)
@@ -2434,6 +2434,9 @@ namespace Game.Entities
RemoveItem(dstbag, dstslot, false);
RemoveItem(srcbag, srcslot, false);
if (srcbag == InventorySlots.Bag0 && srcslot < InventorySlots.BagEnd)
ApplyItemDependentAuras(pSrcItem, false);
// add to dest
if (IsInventoryPos(dst))
StoreItem(_sDest, pSrcItem, true);
@@ -2446,6 +2449,9 @@ namespace Game.Entities
EquipChildItem(srcbag, srcslot, pSrcItem);
}
if (dstbag == InventorySlots.Bag0 && dstslot < InventorySlots.BagEnd)
ApplyItemDependentAuras(pDstItem, false);
// add to src
if (IsInventoryPos(src))
StoreItem(sDest2, pDstItem, true);
@@ -3927,7 +3933,7 @@ namespace Game.Entities
return false;
}
public void _ApplyItemMods(Item item, byte slot, bool apply)
public void _ApplyItemMods(Item item, byte slot, bool apply, bool updateItemAuras = true)
{
if (slot >= InventorySlots.BagEnd || item == null)
return;
@@ -3948,7 +3954,8 @@ namespace Game.Entities
_ApplyItemBonuses(item, slot, apply);
ApplyItemEquipSpell(item, apply);
ApplyItemDependentAuras(item, apply);
if (updateItemAuras)
ApplyItemDependentAuras(item, apply);
ApplyArtifactPowers(item, apply);
ApplyEnchantment(item, apply);