mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
*Temp fix for the crash caused by CastItem.
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user