From 7371bb96e1eebfd6d59678362b6bee5a545a8ff7 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 1 Jun 2011 02:29:56 +0400 Subject: [PATCH] [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. --- src/game/Player.cpp | 17 ++++++++++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index fb2f4d94e..7fbca9f93 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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) - continue; + 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); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index af21304dc..fe70ad6ac 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11577" + #define REVISION_NR "11578" #endif // __REVISION_NR_H__