diff options
author | megamage <none@none> | 2008-12-30 21:29:06 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-30 21:29:06 -0600 |
commit | 950a61e2ea8cc8bd34454ab2d2d47127924e0951 (patch) | |
tree | e71f1c57c8f0b29a410e1e58810a92dc2358e4f0 /src | |
parent | 67ea3f3d0a48683323fa1e4e494cb2c11eacfebb (diff) |
*Temp fix for the crash caused by CastItem.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 8 | ||||
-rw-r--r-- | src/game/Spell.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index c17e5632cb9..672be8614bb 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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); } diff --git a/src/game/Spell.h b/src/game/Spell.h index 17a103ad0c5..b3e4dbc8c6a 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -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; |