*Fix a crash caused by farsight spells.
--HG-- branch : trunk
This commit is contained in:
@@ -514,11 +514,13 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
|
||||
uint64 guid = iter->getSource()->GetCasterGUID();
|
||||
if(IS_PLAYER_GUID(guid))
|
||||
{
|
||||
Player* caster = (Player*)iter->getSource()->GetCaster();
|
||||
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID())
|
||||
BuildPacket(caster);
|
||||
//Caster may be NULL if DynObj is in removelist
|
||||
if(Player *caster = FindPlayer(guid))
|
||||
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID())
|
||||
BuildPacket(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-20
@@ -1264,8 +1264,7 @@ void Aura::DropAuraCharge()
|
||||
{
|
||||
if(m_procCharges) //auras without charges always have charge = 0
|
||||
{
|
||||
--m_procCharges;
|
||||
if(m_procCharges) // Send charge change
|
||||
if(--m_procCharges) // Send charge change
|
||||
SendAuraUpdate();
|
||||
else // Last charge dropped
|
||||
m_target->RemoveAura(this);
|
||||
@@ -1274,39 +1273,30 @@ void Aura::DropAuraCharge()
|
||||
|
||||
bool Aura::IsPersistent() const
|
||||
{
|
||||
for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
|
||||
for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (m_partAuras[i])
|
||||
{
|
||||
if (m_partAuras[i]->IsPersistent())
|
||||
return true;
|
||||
}
|
||||
if(m_partAuras[i] && m_partAuras[i]->IsPersistent())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aura::IsAreaAura() const
|
||||
{
|
||||
for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
|
||||
for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (m_partAuras[i])
|
||||
{
|
||||
if (m_partAuras[i]->IsAreaAura())
|
||||
return true;
|
||||
}
|
||||
if(m_partAuras[i] && m_partAuras[i]->IsAreaAura())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aura::IsAuraType(AuraType type) const
|
||||
{
|
||||
for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
|
||||
for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (m_partAuras[i])
|
||||
{
|
||||
if (m_partAuras[i]->GetAuraName()==type)
|
||||
return true;
|
||||
}
|
||||
if(m_partAuras[i] && m_partAuras[i]->GetAuraName() == type)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user