fix(Core/Spells): Spells and auras activated by item use should not be removed on unequip. (#6255)

- Closes #5124
- Closes chromiecraft/chromiecraft#327
This commit is contained in:
UltraNix
2021-06-10 15:19:15 +02:00
committed by GitHub
parent cb1aaec4af
commit 69c214bec5

View File

@@ -8618,8 +8618,21 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
continue;
// wrong triggering type
if ((apply || form_change) && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_EQUIP)
continue;
if (apply)
{
if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_EQUIP)
{
continue;
}
}
else
{
// Auras activated by use should not be removed on unequip
if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
{
continue;
}
}
// check if it is valid spell
SpellInfo const* spellproto = sSpellMgr->GetSpellInfo(spellData.SpellId);