mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Try to fix some aura update related crashes.
--HG-- branch : trunk
This commit is contained in:
@@ -764,16 +764,19 @@ void AreaAuraEffect::Update(uint32 diff)
|
||||
}
|
||||
else // aura at non-caster
|
||||
{
|
||||
Unit * tmp_target = m_target;
|
||||
// WARNING: the aura may get deleted during the update
|
||||
// DO NOT access its members after update!
|
||||
AuraEffect::Update(diff);
|
||||
|
||||
// Speedup - no need to do more checks
|
||||
if (GetParentAura()->IsRemoved())
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
uint32 tmp_spellId = GetId();
|
||||
uint32 tmp_effIndex = GetEffIndex();
|
||||
uint64 tmp_guid = GetCasterGUID();
|
||||
|
||||
// WARNING: the aura may get deleted during the update
|
||||
// DO NOT access its members after update!
|
||||
AuraEffect::Update(diff);
|
||||
|
||||
// remove aura if out-of-range from caster (after teleport for example)
|
||||
// or caster is isolated or caster no longer has the aura
|
||||
// or caster is (no longer) friendly
|
||||
@@ -841,7 +844,10 @@ void PersistentAreaAuraEffect::Update(uint32 diff)
|
||||
remove = true;
|
||||
|
||||
if(remove)
|
||||
{
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
return;
|
||||
}
|
||||
|
||||
AuraEffect::Update(diff);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user