mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
*Allow auras to be removed during other auras update.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user