aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-26 17:44:00 -0500
committermegamage <none@none>2009-08-26 17:44:00 -0500
commit3cf8ae345c918faef9b01acfa78371d539e24ea2 (patch)
tree6d3318303ce598416b1e265387905658531cb2f7 /src
parenta35991c8365575226394f90071dc97894e94f21c (diff)
*Fix a crash caused by area aura. Thanks to nanouniko
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 67a7d9a5d6f..c1981a05df0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -14554,6 +14554,8 @@ void Unit::SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
aur->SetStackAmount(stack);
}
+// This function is only used for area aura and creature addon
+// it should be removed in the future
Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, WorldObject *source, Unit* caster, int32 * basePoints)
{
// can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect
@@ -14562,8 +14564,14 @@ Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, WorldOb
sLog.outDebug("AddAuraEffect: spell id: %u, effect index: %u", spellInfo->Id, (uint32)effIndex);
Aura *aur = GetAura(spellInfo->Id, caster->GetGUID());
+ // without this it may crash when shaman refresh totem? source is NULL
+ if(aur && aur->GetSourceGUID() != source->GetGUID())
+ {
+ RemoveAura(aur);
+ aur = NULL;
+ }
- if (aur)
+ if(aur)
{
if(AuraEffect *aurEffect = CreateAuraEffect(aur, effIndex, basePoints))
if(!aur->SetPartAura(aurEffect, effIndex))