Core/Auras: Temporary fix for Aura::UpdateTargetMap assertion failure.

This commit is contained in:
QAston
2011-02-12 11:00:56 +01:00
parent 6728d4116b
commit fe2a848b8f
+17 -12
View File
@@ -514,19 +514,24 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
for (std::map<Unit *, uint8>::iterator itr = targets.begin(); itr!= targets.end();) for (std::map<Unit *, uint8>::iterator itr = targets.begin(); itr!= targets.end();)
{ {
// aura mustn't be already applied on target // 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()); // the core created 2 different units with same guid
// check if we have valid pointer // this is a major failue, which i can't fix right now
ASSERT(aurApp->GetTarget()); // let's remove one unit from aura list
// check if we really have same guid // this may cause area aura "bouncing" between 2 units after each update
ASSERT(aurApp->GetTarget()->GetGUID() == itr->first->GetGUID()); // but because we know the reason of a crash we can remove the assertion for now
// check if we really have base aura if (aurApp->GetTarget() != itr->first)
ASSERT(aurApp->GetBase() == this); {
// check if core created 2 units with same guid // remove from auras to register list
ASSERT(aurApp->GetTarget() == itr->first); targets.erase(itr++);
// ok, we have same unit twice in map, how? continue;
ASSERT(false); }
else
{
// ok, we have one unit twice in target map (impossible, but...)
ASSERT(false);
}
} }
bool addUnit = true; bool addUnit = true;