fix(Core/Player): Haunted Memento aura is present when item is in bank (#22811)

This commit is contained in:
Jelle Meeus
2025-09-06 06:28:01 -07:00
committed by GitHub
parent 809a06ad0b
commit d22f015e52
3 changed files with 11 additions and 5 deletions
@@ -7067,6 +7067,14 @@ void Player::ApplyItemObtainSpells(Item* item, bool apply)
} }
} }
void Player::UpdateItemObtainSpells(Item* item, uint8 bag, uint8 slot)
{
if (IsBankPos(bag, slot))
ApplyItemObtainSpells(item, false);
else if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END))
ApplyItemObtainSpells(item, true);
}
SpellSchoolMask Player::GetMeleeDamageSchoolMask(WeaponAttackType attackType /*= BASE_ATTACK*/, uint8 damageIndex /*= 0*/) const SpellSchoolMask Player::GetMeleeDamageSchoolMask(WeaponAttackType attackType /*= BASE_ATTACK*/, uint8 damageIndex /*= 0*/) const
{ {
if (Item const* weapon = GetWeaponForAttack(attackType, true)) if (Item const* weapon = GetWeaponForAttack(attackType, true))
+1
View File
@@ -2208,6 +2208,7 @@ public:
void CastAllObtainSpells(); void CastAllObtainSpells();
void ApplyItemObtainSpells(Item* item, bool apply); void ApplyItemObtainSpells(Item* item, bool apply);
void UpdateItemObtainSpells(Item* item, uint8 bag, uint8 slot);
SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType = BASE_ATTACK, uint8 damageIndex = 0) const override; SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType = BASE_ATTACK, uint8 damageIndex = 0) const override;
@@ -2654,9 +2654,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
AddEnchantmentDurations(pItem); AddEnchantmentDurations(pItem);
AddItemDurations(pItem); AddItemDurations(pItem);
UpdateItemObtainSpells(pItem, bag, slot);
if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END))
ApplyItemObtainSpells(pItem, true);
return pItem; return pItem;
} }
@@ -2694,8 +2692,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
pItem2->SetState(ITEM_CHANGED, this); pItem2->SetState(ITEM_CHANGED, this);
if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) UpdateItemObtainSpells(pItem2, bag, slot);
ApplyItemObtainSpells(pItem2, true);
return pItem2; return pItem2;
} }