Skip to content

Commit

Permalink
[11797] Do not remove item on unrelated auraholder remove
Browse files Browse the repository at this point in the history
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
  • Loading branch information
Vinolentus authored and Schmoozerd committed Sep 18, 2011
1 parent 6425bf5 commit 1ea6ead
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7579,7 +7579,7 @@ void Player::ApplyItemOnStoreSpell(Item *item, bool apply)
}
}

void Player::DestroyItemWithOnStoreSpell(Item* item)
void Player::DestroyItemWithOnStoreSpell(Item* item, uint32 spellId)
{
if (!item)
return;
Expand All @@ -7592,8 +7592,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
Expand Down
2 changes: 1 addition & 1 deletion src/game/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,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);
Expand Down
2 changes: 1 addition & 1 deletion src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8642,7 +8642,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)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11796"
#define REVISION_NR "11797"
#endif // __REVISION_NR_H__

0 comments on commit 1ea6ead

Please sign in to comment.