diff options
author | QAston <qaston@gmail.com> | 2011-02-12 11:00:56 +0100 |
---|---|---|
committer | QAston <qaston@gmail.com> | 2011-02-12 11:00:56 +0100 |
commit | fe2a848b8fee8df23e6ad2a850b5d4998c6992a7 (patch) | |
tree | 6b08bc18a9f5151ebb7f6aa2124ee2b15c6d1692 /src | |
parent | 6728d4116bd0ac191f0032abf1d68bb3d933e6c2 (diff) |
Core/Auras: Temporary fix for Aura::UpdateTargetMap assertion failure.
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 7cafc14cca4..195dbc5f93c 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -514,19 +514,24 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) for (std::map<Unit *, uint8>::iterator itr = targets.begin(); itr!= targets.end();) { // aura mustn't be already applied on target - if (IsAppliedOnTarget(itr->first->GetGUID())) + if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID())) { - AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()); - // check if we have valid pointer - ASSERT(aurApp->GetTarget()); - // check if we really have same guid - ASSERT(aurApp->GetTarget()->GetGUID() == itr->first->GetGUID()); - // check if we really have base aura - ASSERT(aurApp->GetBase() == this); - // check if core created 2 units with same guid - ASSERT(aurApp->GetTarget() == itr->first); - // ok, we have same unit twice in map, how? - ASSERT(false); + // the core created 2 different units with same guid + // this is a major failue, which i can't fix right now + // let's remove one unit from aura list + // this may cause area aura "bouncing" between 2 units after each update + // but because we know the reason of a crash we can remove the assertion for now + if (aurApp->GetTarget() != itr->first) + { + // remove from auras to register list + targets.erase(itr++); + continue; + } + else + { + // ok, we have one unit twice in target map (impossible, but...) + ASSERT(false); + } } bool addUnit = true; |