aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-26 23:10:02 -0600
committermegamage <none@none>2008-11-26 23:10:02 -0600
commit184c75247be792f5b1adb050a4a6ea5d8dbbeb2e (patch)
treef5cfc6a4067835cdda67f5e7634de69d4f378ed8
parent1d4da0c21736b0fc72516c297c6f2c90501165b0 (diff)
*Try to fix the bug that stealth spells cause crash.
--HG-- branch : trunk
-rw-r--r--src/game/Unit.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 2e855283cfe..48651522734 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -492,11 +492,16 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag)
//sLog.outDetail("auraflag:%u flag:%u = %u",(*iter)->GetSpellProto()->AuraInterruptFlags,flag,(*iter)->GetSpellProto()->AuraInterruptFlags & flag);
if(*iter && ((*iter)->GetSpellProto()->AuraInterruptFlags & flag))
{
- RemoveAurasDueToSpell((*iter)->GetId());
- if (!m_interruptableAuras.empty())
- next = m_interruptableAuras.begin();
+ if((*iter)->IsInUse())
+ sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag);
else
- break;
+ {
+ RemoveAurasDueToSpell((*iter)->GetId());
+ if (!m_interruptableAuras.empty())
+ next = m_interruptableAuras.begin();
+ else
+ break;
+ }
}
}