[11578] Prevent lost aura from spell applied at use equipped consumable item.

So aura will not removed at unequip like item with multiply charges,
and will not removed at last charge with item deleting in result.

No like items in 3.x known but exist in prev. client versions.
This commit is contained in:
VladimirMangos 2011-06-01 02:29:56 +04:00
parent c462ee5834
commit 7371bb96e1
2 changed files with 15 additions and 4 deletions

View file

@ -7439,9 +7439,20 @@ void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change)
if(!spellData.SpellId )
continue;
// wrong triggering type
if(apply && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_EQUIP)
if (apply)
{
// apply only at-equip spells
if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_EQUIP)
continue;
}
else
{
// at un-apply remove all spells (not only at-apply, so any at-use active affects from item and etc)
// except with at-use with negative charges, so allow consuming item spells (including with extra flag that prevent consume really)
// applied to player after item remove from equip slot
if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_EQUIP && spellData.SpellCharges < 0)
continue;
}
// check if it is valid spell
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellData.SpellId);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11577"
#define REVISION_NR "11578"
#endif // __REVISION_NR_H__