aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-04-06 22:43:52 +0200
committerQAston <none@none>2009-04-06 22:43:52 +0200
commit81ef5e632fcfe9a565eebfea9556bde78c0a22e3 (patch)
treece8cc4348a8525c8cc2d3c576c48c8013cea9987
parentbf8877342d6e98672f60dbbf53369f7f24da61e0 (diff)
*Fix Freeze
--HG-- branch : trunk
-rw-r--r--src/game/Unit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a0ad4162064..40f3272a905 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3899,7 +3899,7 @@ void Unit::RemoveAura(uint32 spellId, uint64 caster ,AuraRemoveMode removeMode)
{
for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- if (!caster || iter->second->GetCasterGUID()==caster)
+ if ((!caster || iter->second->GetCasterGUID()==caster) && !iter->second->IsDuringUpdate())
{
RemoveAura(iter, removeMode);
return;
@@ -3913,7 +3913,7 @@ void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 caster ,AuraRemoveMode r
{
for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- if (!caster || iter->second->GetCasterGUID()==caster)
+ if ((!caster || iter->second->GetCasterGUID()==caster) && !iter->second->IsDuringUpdate())
{
RemoveAura(iter, removeMode);
iter = m_Auras.lower_bound(spellId);
@@ -4007,7 +4007,7 @@ void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
{
for (AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- if (iter->second->GetCastItemGUID() == castItem->GetGUID())
+ if ((!castItem || iter->second->GetCastItemGUID()==castItem->GetGUID()) && !iter->second->IsDuringUpdate())
{
RemoveAura(iter);
iter = m_Auras.upper_bound(spellId); // overwrite by more appropriate
@@ -4078,6 +4078,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
if (Aur->IsDuringUpdate())
{
Aur->RemoveAura();
+ i++;
return;
}