*Check auraname when auraeffect is constructed
--HG-- branch : trunk
This commit is contained in:
@@ -456,10 +456,9 @@ Aura::~Aura()
|
||||
AuraEffect::AuraEffect(Aura * parentAura, uint8 effIndex, int32 * currentBasePoints , Unit *caster, Item* castItem, WorldObject *source) :
|
||||
m_parentAura(parentAura), m_spellmod(NULL), m_periodicTimer(0), m_isPeriodic(false), m_isAreaAura(false), m_isPersistent(false),
|
||||
m_target(parentAura->GetTarget()), m_tickNumber(0)
|
||||
, m_spellProto(parentAura->GetSpellProto()), m_effIndex(effIndex), m_auraName(AuraType(m_spellProto->EffectApplyAuraName[m_effIndex]))
|
||||
{
|
||||
m_spellProto = parentAura->GetSpellProto();
|
||||
m_effIndex = effIndex;
|
||||
m_auraName = AuraType(m_spellProto->EffectApplyAuraName[m_effIndex]);
|
||||
assert(m_auraName < TOTAL_AURAS);
|
||||
|
||||
if(currentBasePoints)
|
||||
m_currentBasePoints = *currentBasePoints;
|
||||
@@ -533,12 +532,12 @@ AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * curre
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
|
||||
m_areaAuraType = AREA_AURA_PARTY;
|
||||
if(m_target->GetTypeId() == TYPEID_UNIT && ((Creature*)m_target)->isTotem())
|
||||
m_auraName = SPELL_AURA_NONE;
|
||||
const_cast<AuraType>(m_auraName) = SPELL_AURA_NONE;
|
||||
break;
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_RAID:
|
||||
m_areaAuraType = AREA_AURA_RAID;
|
||||
if(m_target->GetTypeId() == TYPEID_UNIT && ((Creature*)m_target)->isTotem())
|
||||
m_auraName = SPELL_AURA_NONE;
|
||||
const_cast<AuraType>(m_auraName) = SPELL_AURA_NONE;
|
||||
break;
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
|
||||
m_areaAuraType = AREA_AURA_FRIEND;
|
||||
@@ -546,7 +545,7 @@ AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * curre
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||
m_areaAuraType = AREA_AURA_ENEMY;
|
||||
if(m_target == caster_ptr)
|
||||
m_auraName = SPELL_AURA_NONE; // Do not do any effect on self
|
||||
const_cast<AuraType>(m_auraName) = SPELL_AURA_NONE; // Do not do any effect on self
|
||||
break;
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
||||
m_areaAuraType = AREA_AURA_PET;
|
||||
@@ -554,7 +553,7 @@ AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * curre
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
|
||||
m_areaAuraType = AREA_AURA_OWNER;
|
||||
if(m_target == caster_ptr)
|
||||
m_auraName = SPELL_AURA_NONE;
|
||||
const_cast<AuraType>(m_auraName) = SPELL_AURA_NONE;
|
||||
break;
|
||||
default:
|
||||
sLog.outError("Wrong spell effect in AreaAura constructor");
|
||||
@@ -856,7 +855,6 @@ void AuraEffect::ApplyModifier(bool apply, bool Real, bool changeAmount)
|
||||
if (GetParentAura()->IsRemoved())
|
||||
return;
|
||||
|
||||
if(m_auraName<TOTAL_AURAS)
|
||||
(*this.*AuraHandler [m_auraName])(apply,Real, changeAmount);
|
||||
}
|
||||
|
||||
|
||||
@@ -377,11 +377,11 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
Unit * const m_target;
|
||||
uint64 m_sourceGUID; // Spell::m_caster/trap? for normal aura, totem/paladin for areaaura, dynobj for persistent aura
|
||||
|
||||
SpellEntry const *m_spellProto;
|
||||
uint32 m_tickNumber;
|
||||
|
||||
uint8 m_effIndex;
|
||||
AuraType m_auraName;
|
||||
const SpellEntry * const m_spellProto;
|
||||
const uint8 m_effIndex;
|
||||
const AuraType m_auraName;
|
||||
int32 m_currentBasePoints;
|
||||
int32 m_amount;
|
||||
|
||||
|
||||
+1
-3
@@ -4099,7 +4099,6 @@ void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
|
||||
|
||||
void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except)
|
||||
{
|
||||
if (auraType >= TOTAL_AURAS) return;
|
||||
for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();)
|
||||
{
|
||||
Aura * aur = (*iter)->GetParentAura();
|
||||
@@ -4116,7 +4115,6 @@ void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except
|
||||
|
||||
void Unit::RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell)
|
||||
{
|
||||
if (auraType >= TOTAL_AURAS) return;
|
||||
std::queue < std::pair < uint32, uint64 > > remove_list;
|
||||
|
||||
for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();++iter)
|
||||
@@ -11999,7 +11997,7 @@ typedef std::list< ProcTriggeredData > ProcTriggeredList;
|
||||
// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic
|
||||
bool InitTriggerAuraData()
|
||||
{
|
||||
for (int i=0;i<TOTAL_AURAS;i++)
|
||||
for (int i = 0; i < TOTAL_AURAS; ++i)
|
||||
{
|
||||
isTriggerAura[i]=false;
|
||||
isNonTriggerAura[i] = false;
|
||||
|
||||
Reference in New Issue
Block a user