diff options
| author | QAston <none@none> | 2009-04-12 17:53:05 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2009-04-12 17:53:05 +0200 |
| commit | cb5b56785fe8b57645b159c519cb41301a67e25d (patch) | |
| tree | 4804c5aca15af43be7bfced9fc3a0f03f8773230 /src | |
| parent | fcbdb1012212fee36f67dee764efb089f4e40584 (diff) | |
Try to fix some aura update related crashes.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/SpellAuras.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 955539b4c53..a52d9b81634 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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); } |
