*Temp fix for the crash caused by CastItem.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-30 21:29:06 -06:00
parent 67ea3f3d0a
commit 950a61e2ea
2 changed files with 9 additions and 0 deletions

View File

@@ -2027,6 +2027,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
{
if(m_CastItem)
m_castItemGUID = m_CastItem->GetGUID();
else
m_castItemGUID = 0;
m_targets = *targets;
m_spellState = SPELL_STATE_PREPARING;
@@ -4986,6 +4991,9 @@ void Spell::UpdatePointers()
if(m_originalCaster && !m_originalCaster->IsInWorld()) m_originalCaster = NULL;
}
if(m_castItemGUID && m_caster->GetTypeId() == TYPEID_PLAYER)
m_CastItem = ((Player*)m_caster)->GetItemByGuid(m_castItemGUID);
m_targets.Update(m_caster);
}

View File

@@ -385,6 +385,7 @@ class Spell
SpellEntry const* m_spellInfo;
int32 m_currentBasePoints[3]; // cache SpellEntry::EffectBasePoints and use for set custom base points
Item* m_CastItem;
uint64 m_castItemGUID;
uint8 m_cast_count;
SpellCastTargets m_targets;