*Change way of aura removing-make it safer.
--HG-- branch : trunk
This commit is contained in:
+1
-2
@@ -6320,8 +6320,7 @@ void Player::DuelComplete(DuelCompleteType type)
|
||||
++i;
|
||||
}
|
||||
|
||||
vAuras = GetAuras();
|
||||
for(AuraMap::iterator i = vAuras.begin(); i != vAuras.end();)
|
||||
for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
|
||||
{
|
||||
if (!i->second->IsPositive() && i->second->GetCasterGUID() == duel->opponent->GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
|
||||
{
|
||||
|
||||
+26
-36
@@ -344,8 +344,8 @@ 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_NO_REMOVE_MODE), m_AuraDRGroup(DIMINISHING_NONE),
|
||||
m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_in_use(false)
|
||||
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_isRemoved(false)
|
||||
{
|
||||
assert(target);
|
||||
|
||||
@@ -462,19 +462,6 @@ m_target(parentAura->GetTarget())
|
||||
m_effIndex = effIndex;
|
||||
m_auraName = AuraType(m_spellProto->EffectApplyAuraName[m_effIndex]);
|
||||
|
||||
/*if(currentBasePoints)
|
||||
{
|
||||
m_amount = *currentBasePoints;
|
||||
m_currentBasePoints = m_amount - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentBasePoints = m_spellProto->EffectBasePoints[m_effIndex];
|
||||
if(caster)
|
||||
m_amount = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, m_target);
|
||||
else
|
||||
m_amount = m_currentBasePoints + 1;
|
||||
}*/
|
||||
if(currentBasePoints)
|
||||
m_currentBasePoints = *currentBasePoints;
|
||||
else
|
||||
@@ -637,12 +624,12 @@ void Aura::Update(uint32 diff)
|
||||
if (caster->GetHealth()>manaPerSecond)
|
||||
caster->ModifyHealth(-manaPerSecond);
|
||||
else
|
||||
RemoveAura();
|
||||
m_target->RemoveAura(this);
|
||||
}
|
||||
else if (caster->GetPower(powertype)>=manaPerSecond)
|
||||
caster->ModifyPower(powertype,-manaPerSecond);
|
||||
else
|
||||
RemoveAura();
|
||||
m_target->RemoveAura(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,7 +641,7 @@ void Aura::Update(uint32 diff)
|
||||
Unit* caster = GetCaster();
|
||||
if(!caster)
|
||||
{
|
||||
RemoveAura();
|
||||
m_target->RemoveAura(this);
|
||||
return;
|
||||
}
|
||||
// Get spell range
|
||||
@@ -680,7 +667,7 @@ void Aura::Update(uint32 diff)
|
||||
|
||||
if(!caster->IsWithinDistInMap(m_target,radius))
|
||||
{
|
||||
RemoveAura();
|
||||
m_target->RemoveAura(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -796,7 +783,7 @@ void AreaAuraEffect::Update(uint32 diff)
|
||||
caster->IsFriendlyTo(tmp_target) != needFriendly
|
||||
)
|
||||
{
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
else if (!caster->IsWithinDistInMap(tmp_target, m_radius))
|
||||
{
|
||||
@@ -804,10 +791,10 @@ void AreaAuraEffect::Update(uint32 diff)
|
||||
{
|
||||
m_removeTime -= diff;
|
||||
if (m_removeTime < 0)
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
else
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -816,17 +803,17 @@ void AreaAuraEffect::Update(uint32 diff)
|
||||
if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
|
||||
{
|
||||
if(!tmp_target->IsInPartyWith(caster))
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
else if( m_areaAuraType == AREA_AURA_RAID)
|
||||
{
|
||||
if(!tmp_target->IsInRaidWith(caster))
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
|
||||
{
|
||||
if( tmp_target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -854,22 +841,18 @@ void PersistentAreaAuraEffect::Update(uint32 diff)
|
||||
remove = true;
|
||||
|
||||
if(remove)
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAura(GetParentAura());
|
||||
|
||||
AuraEffect::Update(diff);
|
||||
}
|
||||
|
||||
void AuraEffect::ApplyModifier(bool apply, bool Real)
|
||||
{
|
||||
AuraType aura = m_auraName;
|
||||
if (GetParentAura()->IsRemoved())
|
||||
return;
|
||||
|
||||
bool inuse = GetParentAura()->IsInUse();
|
||||
if (!inuse)
|
||||
GetParentAura()->SetInUse(true);
|
||||
if(aura<TOTAL_AURAS)
|
||||
(*this.*AuraHandler [aura])(apply,Real);
|
||||
if (!inuse)
|
||||
GetParentAura()->SetInUse(false);
|
||||
if(m_auraName<TOTAL_AURAS)
|
||||
(*this.*AuraHandler [m_auraName])(apply,Real);
|
||||
}
|
||||
|
||||
void AuraEffect::CleanupTriggeredSpells()
|
||||
@@ -1078,6 +1061,8 @@ void Aura::_AddAura()
|
||||
|
||||
bool Aura::SetPartAura(AuraEffect* aurEff, uint8 effIndex)
|
||||
{
|
||||
if (IsRemoved())
|
||||
return false;
|
||||
if (m_auraFlags & (1<<effIndex))
|
||||
return false;
|
||||
m_auraFlags |= 1<<effIndex;
|
||||
@@ -1138,6 +1123,11 @@ void Aura::_RemoveAura()
|
||||
m_target->ApplyModFlag(UNIT_FIELD_AURASTATE, foundMask, false);
|
||||
}
|
||||
|
||||
// since now aura cannot apply/remove it's modifiers
|
||||
m_isRemoved = true;
|
||||
// disable client server communication for removed aura
|
||||
SetAuraSlot(MAX_AURAS);
|
||||
|
||||
// reset cooldown state for spells
|
||||
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -4270,7 +4260,7 @@ void AuraEffect::HandlePeriodicTriggerSpell(bool apply, bool Real)
|
||||
m_isPeriodic = apply;
|
||||
if (m_spellProto->Id == 66 && !apply)
|
||||
{
|
||||
if (GetParentAura()->GetRemoveMode() && GetParentAura()->GetAuraDuration()<=0)
|
||||
if (GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
m_target->CastSpell(m_target, 32612, true, NULL, this);
|
||||
}
|
||||
}
|
||||
@@ -5650,7 +5640,7 @@ void AuraEffect::PeriodicTick()
|
||||
100;
|
||||
if(m_target->GetHealth()*100 >= m_target->GetMaxHealth()*percent )
|
||||
{
|
||||
GetParentAura()->RemoveAura();
|
||||
m_target->RemoveAurasDueToSpell(GetId());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -92,17 +92,14 @@ class TRINITY_DLL_SPEC Aura
|
||||
void SetNegative() { m_positive = false; }
|
||||
void SetPositive() { m_positive = true; }
|
||||
bool IsPermanent() const { return m_permanent; }
|
||||
void RemoveAura(AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT) { m_permanent = false; m_duration=0; m_removeMode = mode; }
|
||||
|
||||
bool IsPassive() const { return m_isPassive; }
|
||||
bool IsDeathPersistent() const { return m_isDeathPersist; }
|
||||
bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
|
||||
bool IsUpdated() const { return m_updated; }
|
||||
bool IsRemoved() const { return m_isRemoved; }
|
||||
void SetUpdated(bool val) { m_updated = val; }
|
||||
|
||||
bool IsInUse() const { return m_in_use; }
|
||||
void SetInUse(bool val) { m_in_use = val; }
|
||||
|
||||
bool IsPersistent() const;
|
||||
bool IsAreaAura() const;
|
||||
bool IsAuraType(AuraType type) const;
|
||||
@@ -158,8 +155,8 @@ class TRINITY_DLL_SPEC Aura
|
||||
bool m_isPassive:1;
|
||||
bool m_positive:1;
|
||||
bool m_permanent:1;
|
||||
bool m_isRemoved:1;
|
||||
bool m_updated:1; // Prevent remove aura by stack if set
|
||||
bool m_in_use:1;
|
||||
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
|
||||
|
||||
+55
-51
@@ -159,7 +159,6 @@ Unit::Unit()
|
||||
for (int i = 0; i < MAX_MOVE_TYPE; ++i)
|
||||
m_speed_rate[i] = 1.0f;
|
||||
|
||||
m_removedAuras = 0;
|
||||
m_charmInfo = NULL;
|
||||
m_unit_movement_flags = 0;
|
||||
m_reducedThreatPercent = 0;
|
||||
@@ -182,6 +181,14 @@ Unit::~Unit()
|
||||
}
|
||||
}
|
||||
|
||||
for (AuraList::iterator i = m_removedAuras.begin(); i != m_removedAuras.end();i = m_removedAuras.begin())
|
||||
{
|
||||
Aura * aur = *i;
|
||||
sLog.outDebug("Aura %d is deleted from unit %d", aur->GetId(), GetGUIDLow());
|
||||
m_removedAuras.pop_front();
|
||||
delete (aur);
|
||||
}
|
||||
|
||||
RemoveAllGameObjects();
|
||||
RemoveAllDynObjects();
|
||||
|
||||
@@ -472,7 +479,10 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
|
||||
++iter;
|
||||
if ((aur->GetSpellProto()->AuraInterruptFlags & flag) && (!except || aur->GetId() != except))
|
||||
{
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
RemoveAura(aur);
|
||||
if (removedAuras+1<m_removedAuras.size())
|
||||
iter=m_interruptableAuras.begin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +523,10 @@ void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
|
||||
++iter;
|
||||
if ((!spell || aur->GetId() != spell) && roll_chance_f(chance))
|
||||
{
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
RemoveAura(aur);
|
||||
if (removedAuras+1<m_ccAuras.size())
|
||||
iter=m_interruptableAuras.begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1659,7 +1672,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
|
||||
// victim's damage shield
|
||||
std::set<AuraEffect*> alreadyDone;
|
||||
uint32 removedAuras = pVictim->m_removedAuras;
|
||||
uint32 removedAuras = pVictim->m_removedAuras.size();
|
||||
AuraEffectList const& vDamageShields = pVictim->GetAurasByType(SPELL_AURA_DAMAGE_SHIELD);
|
||||
for(AuraEffectList::const_iterator i = vDamageShields.begin(), next = vDamageShields.begin(); i != vDamageShields.end(); i = next)
|
||||
{
|
||||
@@ -1688,9 +1701,9 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
|
||||
pVictim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, GetSpellSchoolMask(spellProto), spellProto, true);
|
||||
|
||||
if (pVictim->m_removedAuras > removedAuras)
|
||||
if (pVictim->m_removedAuras.size() > removedAuras)
|
||||
{
|
||||
removedAuras = pVictim->m_removedAuras;
|
||||
removedAuras = pVictim->m_removedAuras.size();
|
||||
next = vDamageShields.begin();
|
||||
}
|
||||
}
|
||||
@@ -2083,7 +2096,10 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||
++i;
|
||||
if (auraeff->GetAmount()<=0)
|
||||
{
|
||||
uint32 removedAuras = pVictim->m_removedAuras.size();
|
||||
pVictim->RemoveAura(aura);
|
||||
if (removedAuras+1<pVictim->m_removedAuras.size())
|
||||
i=vSchoolAbsorb.begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3199,11 +3215,9 @@ void Unit::_UpdateSpells( uint32 time )
|
||||
}
|
||||
|
||||
// TODO: Find a better way to prevent crash when multiple auras are removed.
|
||||
m_removedAuras = 0;
|
||||
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
|
||||
if ((*i).second)
|
||||
(*i).second->SetUpdated(false);
|
||||
|
||||
for (AuraMap::iterator i = m_Auras.begin(), next; i != m_Auras.end(); i = next)
|
||||
{
|
||||
next = i;
|
||||
@@ -3213,16 +3227,15 @@ void Unit::_UpdateSpells( uint32 time )
|
||||
// prevent double update
|
||||
if ((*i).second->IsUpdated())
|
||||
continue;
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
(*i).second->SetUpdated(true);
|
||||
(*i).second->SetInUse(true);
|
||||
(*i).second->Update( time );
|
||||
(*i).second->SetInUse(false);
|
||||
// several auras can be deleted due to update
|
||||
if (m_removedAuras)
|
||||
if (removedAuras < m_removedAuras.size())
|
||||
{
|
||||
if (m_Auras.empty()) break;
|
||||
next = m_Auras.begin();
|
||||
m_removedAuras = 0;
|
||||
removedAuras = m_removedAuras.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3246,6 +3259,14 @@ void Unit::_UpdateSpells( uint32 time )
|
||||
}
|
||||
}
|
||||
|
||||
for (AuraList::iterator i = m_removedAuras.begin(); i != m_removedAuras.end();i = m_removedAuras.begin())
|
||||
{
|
||||
Aura * aur = *i;
|
||||
sLog.outDebug("Aura %d is deleted from unit %d", aur->GetId(), GetGUIDLow());
|
||||
m_removedAuras.pop_front();
|
||||
delete (aur);
|
||||
}
|
||||
|
||||
if(!m_gameObj.empty())
|
||||
{
|
||||
std::list<GameObject*>::iterator ite1, dnext1;
|
||||
@@ -3799,7 +3820,6 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||
{
|
||||
next = i;
|
||||
++next;
|
||||
if ((*i).second->IsInUse()) continue;
|
||||
|
||||
SpellEntry const* i_spellProto = (*i).second->GetSpellProto();
|
||||
|
||||
@@ -3875,12 +3895,9 @@ void Unit::RemoveAura(uint32 spellId, uint64 caster ,AuraRemoveMode removeMode)
|
||||
|
||||
void Unit::RemoveAura(Aura * aur ,AuraRemoveMode mode)
|
||||
{
|
||||
if (aur->IsInUse())
|
||||
{
|
||||
if (!aur->GetRemoveMode())
|
||||
aur->RemoveAura(mode);
|
||||
// no need to remove
|
||||
if (aur->IsRemoved())
|
||||
return;
|
||||
}
|
||||
for(AuraMap::iterator iter = m_Auras.lower_bound(aur->GetId()); iter != m_Auras.upper_bound(aur->GetId());)
|
||||
{
|
||||
if (aur == iter->second)
|
||||
@@ -3897,7 +3914,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) && (!iter->second->IsInUse() || !iter->second->GetRemoveMode()))
|
||||
if (!caster || iter->second->GetCasterGUID()==caster)
|
||||
{
|
||||
RemoveAura(iter, removeMode);
|
||||
iter = m_Auras.lower_bound(spellId);
|
||||
@@ -3976,9 +3993,9 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
|
||||
// Unregister _before_ adding to stealer
|
||||
aur->UnregisterSingleCastAura();
|
||||
|
||||
// strange but intended behaviour: Stolen single target auras won't be treated as single targeted
|
||||
new_aur->SetIsSingleTarget(false);
|
||||
stealer->AddAura(new_aur);
|
||||
RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
return;
|
||||
}
|
||||
@@ -3991,7 +4008,7 @@ void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
|
||||
{
|
||||
for (AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
|
||||
{
|
||||
if ((!castItem || iter->second->GetCastItemGUID()==castItem->GetGUID()) && (!iter->second->IsInUse() || !iter->second->GetRemoveMode()))
|
||||
if (!castItem || iter->second->GetCastItemGUID()==castItem->GetGUID())
|
||||
{
|
||||
RemoveAura(iter);
|
||||
iter = m_Auras.upper_bound(spellId); // overwrite by more appropriate
|
||||
@@ -4010,7 +4027,10 @@ void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except
|
||||
++iter;
|
||||
if (aur != except && (!casterGUID || aur->GetCasterGUID()==casterGUID))
|
||||
{
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
RemoveAura(aur);
|
||||
if (removedAuras+1<m_removedAuras.size())
|
||||
iter=m_modAuras[auraType].begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4024,7 +4044,10 @@ void Unit::RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell)
|
||||
++iter;
|
||||
if (GetDispelChance(spell, aur->GetCaster(), aur->GetId()))
|
||||
{
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
RemoveAura(aur, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
if (removedAuras+1<m_removedAuras.size())
|
||||
iter=m_modAuras[auraType].begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4043,36 +4066,27 @@ void Unit::RemoveNotOwnSingleTargetAuras()
|
||||
// single target auras at other targets
|
||||
AuraList& scAuras = GetSingleCastAuras();
|
||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
|
||||
{
|
||||
if ((*iter)->GetTarget()!=this)
|
||||
{
|
||||
Aura * aur=*iter;
|
||||
++iter;
|
||||
if (aur->GetTarget()!=this)
|
||||
{
|
||||
uint32 removedAuras = m_removedAuras.size();
|
||||
aur->GetTarget()->RemoveAura(aur->GetId(),aur->GetCasterGUID());
|
||||
if (removedAuras+1<m_removedAuras.size())
|
||||
iter=scAuras.begin();
|
||||
}
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
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->IsInUse())
|
||||
{
|
||||
if (!Aur->GetRemoveMode())
|
||||
Aur->RemoveAura(mode);
|
||||
i++;
|
||||
return;
|
||||
}
|
||||
|
||||
SpellEntry const* AurSpellInfo = Aur->GetSpellProto();
|
||||
|
||||
// some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura
|
||||
// remove aura from list before to prevent deleting it before
|
||||
m_Auras.erase(i);
|
||||
++m_removedAuras; // internal count used by unit update
|
||||
|
||||
Aur->UnregisterSingleCastAura();
|
||||
|
||||
@@ -4089,10 +4103,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
m_ccAuras.remove(Aur);
|
||||
}
|
||||
|
||||
// Set remove mode if mode already not set
|
||||
if (!Aur->GetRemoveMode())
|
||||
Aur->SetRemoveMode(mode);
|
||||
|
||||
// Statue unsummoned at aura remove
|
||||
Totem* statue = NULL;
|
||||
bool channeled = false;
|
||||
@@ -4141,11 +4151,15 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
}
|
||||
}
|
||||
|
||||
Aur->SetRemoveMode(mode);
|
||||
|
||||
sLog.outDebug("Aura %u now is remove mode %d", Aur->GetId(), mode);
|
||||
Aur->HandleEffects(false);
|
||||
Aur->_RemoveAura();
|
||||
|
||||
delete Aur;
|
||||
// set aura to be removed during unit::_updatespells
|
||||
m_removedAuras.push_back(Aur);
|
||||
|
||||
Aur->_RemoveAura();
|
||||
|
||||
if(statue)
|
||||
statue->UnSummon();
|
||||
@@ -11491,10 +11505,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
if (!parentAura)
|
||||
continue;
|
||||
|
||||
bool inuse = parentAura->IsInUse();
|
||||
if (!inuse)
|
||||
parentAura->SetInUse(true);
|
||||
|
||||
bool useCharges= parentAura->GetAuraCharges()>0;
|
||||
bool takeCharges = false;
|
||||
|
||||
@@ -11627,13 +11637,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
}
|
||||
takeCharges=true;
|
||||
}
|
||||
if (!inuse)
|
||||
parentAura->SetInUse(false);
|
||||
|
||||
if ( !parentAura->GetAuraDuration() && !(parentAura->IsPermanent() || (parentAura->IsPassive())) )
|
||||
RemoveAura(parentAura);
|
||||
else
|
||||
{
|
||||
// Remove charge (aura can be removed by triggers)
|
||||
if(useCharges && takeCharges)
|
||||
{
|
||||
@@ -11642,7 +11645,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
|
||||
{
|
||||
@@ -13123,6 +13125,8 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
|
||||
|
||||
void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply)
|
||||
{
|
||||
if (aureff->GetParentAura()->IsRemoved())
|
||||
return;
|
||||
if (apply)
|
||||
{
|
||||
m_modAuras[aureff->GetAuraName()].push_back(aureff);
|
||||
|
||||
+1
-2
@@ -328,7 +328,6 @@ enum DamageTypeToSchool
|
||||
|
||||
enum AuraRemoveMode
|
||||
{
|
||||
AURA_NO_REMOVE_MODE = 0,
|
||||
AURA_REMOVE_BY_DEFAULT,
|
||||
AURA_REMOVE_BY_STACK, // change stack, single aura remove,
|
||||
AURA_REMOVE_BY_CANCEL,
|
||||
@@ -1576,12 +1575,12 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
std::list<GameObject*> m_gameObj;
|
||||
bool m_isSorted;
|
||||
uint32 m_transform;
|
||||
uint32 m_removedAuras;
|
||||
|
||||
AuraEffectList m_modAuras[TOTAL_AURAS];
|
||||
AuraList m_scAuras; // casted singlecast auras
|
||||
AuraList m_interruptableAuras;
|
||||
AuraList m_ccAuras;
|
||||
AuraList m_removedAuras;
|
||||
uint32 m_interruptMask;
|
||||
|
||||
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END];
|
||||
|
||||
Reference in New Issue
Block a user