mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(Core/Item): remove item auras after unequipping an item. (#7398)
* [Core/Item]: Remove item auras after unequipping an item. * chore(Core/Item): add brackets, improve codestyle * Update * update * Update * Update * constexpr * Update Player.cpp
This commit is contained in:
@@ -6907,6 +6907,10 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
|
||||
if (!spellData.SpellId)
|
||||
continue;
|
||||
|
||||
// Spells that should stay on the caster after removing the item.
|
||||
constexpr std::array<uint32, 1> spellExceptions = { /*Electromagnetic Gigaflux Reactivator*/ 11826 };
|
||||
const auto found = std::find(std::begin(spellExceptions), std::end(spellExceptions), spellData.SpellId);
|
||||
|
||||
// wrong triggering type
|
||||
if (apply)
|
||||
{
|
||||
@@ -6917,8 +6921,8 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Auras activated by use should not be removed on unequip (with no charges)
|
||||
if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_USE && spellData.SpellCharges <= 0)
|
||||
// If the spell is an exception do not remove it.
|
||||
if (found != std::end(spellExceptions))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user