Skip to content

Instantly share code, notes, and snippets.

@cenfa
Created August 11, 2011 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cenfa/1140673 to your computer and use it in GitHub Desktop.
Save cenfa/1140673 to your computer and use it in GitHub Desktop.
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index d3ab957..088adfb 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -7782,7 +7782,7 @@ void Player::ApplyItemOnStoreSpell(Item *item, bool apply)
}
}
-void Player::DestroyItemWithOnStoreSpell(Item* item)
+void Player::DestroyItemWithOnStoreSpell(Item* item, uint32 spellId)
{
if (!item)
return;
@@ -7795,8 +7795,7 @@ void Player::DestroyItemWithOnStoreSpell(Item* item)
{
_Spell const& spellData = proto->Spells[i];
- // no spell
- if (!spellData.SpellId)
+ if (spellData.SpellId != spellId)
continue;
// apply/unapply only at-store spells
diff --git a/src/game/Player.h b/src/game/Player.h
index 0815ed1..3682aca 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2128,7 +2128,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex);
void ApplyItemOnStoreSpell(Item *item, bool apply);
- void DestroyItemWithOnStoreSpell(Item* item);
+ void DestroyItemWithOnStoreSpell(Item* item, uint32 spellId);
void SendEquipmentSetList();
void SetEquipmentSet(uint32 index, EquipmentSet eqset);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 1938113..5fd985a 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -9213,7 +9213,7 @@ void SpellAuraHolder::_RemoveSpellAuraHolder()
if (m_target->GetTypeId() == TYPEID_PLAYER && m_removeMode != AURA_REMOVE_BY_DEFAULT && m_removeMode != AURA_REMOVE_BY_DELETE)
if (ObjectGuid castItemGuid = GetCastItemGuid())
if (Item* castItem = ((Player*)m_target)->GetItemByGuid(castItemGuid))
- ((Player*)m_target)->DestroyItemWithOnStoreSpell(castItem);
+ ((Player*)m_target)->DestroyItemWithOnStoreSpell(castItem, GetId());
//passive auras do not get put in slots - said who? ;)
// Note: but totem can be not accessible for aura target in time remove (to far for find in grid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment