aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-04-06 22:03:05 +0200
committerQAston <none@none>2009-04-06 22:03:05 +0200
commitbf8877342d6e98672f60dbbf53369f7f24da61e0 (patch)
tree4312c82f127a4a21934fcdbc0071d749c8b544c1 /src
parent1bd539103bfb99bd05a0f973eae259296dc00d57 (diff)
*Allow auras to be removed during other auras update.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuras.cpp4
-rw-r--r--src/game/SpellAuras.h2
-rw-r--r--src/game/Unit.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index a70e55b4faa..97f48ee298a 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -345,7 +345,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
Aura::Aura(SpellEntry const* spellproto, uint32 effMask, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
m_caster_guid(0), m_castItemGuid(castItem?castItem->GetGUID():0), m_target(target),
m_timeCla(1000), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
-m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false)
+m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_duringUpdate(false)
{
assert(target);
@@ -676,6 +676,7 @@ void Aura::Update(uint32 diff)
}
}
+ m_duringUpdate=true;
for (uint8 i = 0; i<MAX_SPELL_EFFECTS;++i)
if (m_partAuras[i])
{
@@ -686,6 +687,7 @@ void Aura::Update(uint32 diff)
else
m_partAuras[i]->Update(diff);
}
+ m_duringUpdate=false;
}
void AuraEffect::Update(uint32 diff)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 12249bc3976..39d537bbd5b 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -98,6 +98,7 @@ class TRINITY_DLL_SPEC Aura
bool IsDeathPersistent() const { return m_isDeathPersist; }
bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
bool IsUpdated() const { return m_updated; }
+ bool IsDuringUpdate() const { return m_duringUpdate; }
void SetUpdated(bool val) { m_updated = val; }
bool IsInUse() const;
@@ -157,6 +158,7 @@ class TRINITY_DLL_SPEC Aura
bool m_positive:1;
bool m_permanent:1;
bool m_updated:1; // Prevent remove aura by stack if set
+ bool m_duringUpdate:1; // Prevent remove aura by stack if set
bool m_isSingleTargetAura:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
};
class TRINITY_DLL_SPEC AuraEffect
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 81c1e6f388a..a0ad4162064 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4075,7 +4075,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
{
Aura* Aur = i->second;
//aura can be during update when removing, set it to remove at next update
- if (Aur->IsUpdated())
+ if (Aur->IsDuringUpdate())
{
Aur->RemoveAura();
return;