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)
|
if (!spellData.SpellId)
|
||||||
continue;
|
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
|
// wrong triggering type
|
||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
@@ -6917,8 +6921,8 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Auras activated by use should not be removed on unequip (with no charges)
|
// If the spell is an exception do not remove it.
|
||||||
if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_USE && spellData.SpellCharges <= 0)
|
if (found != std::end(spellExceptions))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user