From fe7a8e1bc92fd0a98ab4b050aa6681aea7ca10a2 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 7 Apr 2009 15:34:17 -0500 Subject: [PATCH] *Fix a dead loop in aura update. Sorry. Thanks to QAston for pointing out the mistake. --HG-- branch : trunk --- src/game/Player.cpp | 2 +- src/game/Unit.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2eeb5d3548c..ded28b9c9ec 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6273,7 +6273,7 @@ void Player::DuelComplete(DuelCompleteType type) if(!duel) return; - sLog.outDebug("Dual Complete %s %s", GetName(), duel->opponent->GetName()); + sLog.outDebug("Duel Complete %s %s", GetName(), duel->opponent->GetName()); WorldPacket data(SMSG_DUEL_COMPLETE, (1)); data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 21a6ec75e7e..83bf327d309 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3223,8 +3223,12 @@ void Unit::_UpdateSpells( uint32 time ) Aura *aur = i->second; // prevent double update - if (aur->IsUpdated()) + if(aur->IsUpdated()) + { + ++i; continue; + } + aur->SetUpdated(true); uint32 removedAuras = m_removedAuras.size(); @@ -3232,11 +3236,9 @@ void Unit::_UpdateSpells( uint32 time ) // several auras can be deleted due to update if(removedAuras < m_removedAuras.size()) - { i = m_Auras.begin(); - } else - ++i; + ++i; } for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)