[9984] Implement item 43214 work.

* Original version suggested by timmit.
* Required DB support for target requirement.
This commit is contained in:
VladimirMangos 2010-05-27 19:08:24 +04:00
parent 6ce82e4914
commit 86bef7ace5
5 changed files with 27 additions and 17 deletions

View file

@ -3857,10 +3857,7 @@ void Spell::TakeCastItem()
((Player*)m_caster)->DestroyItemCount(m_CastItem, count, true);
// prevent crash at access to deleted m_targets.getItemTarget
if(m_CastItem == m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
ClearCastItem();
}
}
@ -6634,4 +6631,12 @@ void Spell::SelectMountByAreaAndSkill(Unit* target, uint32 spellId75, uint32 spe
target->CastSpell(target, spellId75, true);
return;
}
void Spell::ClearCastItem()
{
if (m_CastItem==m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
}