[9403] Replace number with enum name where explicitly used in array/other checks

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-02-17 19:06:09 +01:00
parent 5c05280c44
commit 7c555add76
14 changed files with 128 additions and 128 deletions

View file

@ -104,8 +104,8 @@ bool IsQuestTameSpell(uint32 spellId)
if (!spellproto)
return false;
return spellproto->Effect[0] == SPELL_EFFECT_THREAT
&& spellproto->Effect[1] == SPELL_EFFECT_APPLY_AURA && spellproto->EffectApplyAuraName[1] == SPELL_AURA_DUMMY;
return spellproto->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_THREAT
&& spellproto->Effect[EFFECT_INDEX_1] == SPELL_EFFECT_APPLY_AURA && spellproto->EffectApplyAuraName[EFFECT_INDEX_1] == SPELL_AURA_DUMMY;
}
SpellCastTargets::SpellCastTargets()
@ -1362,9 +1362,9 @@ void Spell::SetTargetMap(uint32 effIndex, uint32 targetMode, UnitList& targetUni
// overwrite EffectChainTarget for non single target spell
if (Spell* currSpell = m_caster->GetCurrentSpell(CURRENT_GENERIC_SPELL))
if (currSpell->m_spellInfo->MaxAffectedTargets > 0 ||
currSpell->m_spellInfo->EffectChainTarget[0] > 0 ||
currSpell->m_spellInfo->EffectChainTarget[1] > 0 ||
currSpell->m_spellInfo->EffectChainTarget[2] > 0)
currSpell->m_spellInfo->EffectChainTarget[EFFECT_INDEX_0] > 0 ||
currSpell->m_spellInfo->EffectChainTarget[EFFECT_INDEX_1] > 0 ||
currSpell->m_spellInfo->EffectChainTarget[EFFECT_INDEX_2] > 0)
EffectChainTarget = 0; // no chain targets
}
break;
@ -2900,7 +2900,7 @@ void Spell::update(uint32 difftime)
// check if the player caster has moved before the spell finished
if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) &&
(m_castPositionX != m_caster->GetPositionX() || m_castPositionY != m_caster->GetPositionY() || m_castPositionZ != m_caster->GetPositionZ()) &&
(m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR)))
(m_spellInfo->Effect[EFFECT_INDEX_0] != SPELL_EFFECT_STUCK || !((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR)))
{
// always cancel for channeled spells
if( m_spellState == SPELL_STATE_CASTING )
@ -3436,12 +3436,12 @@ void Spell::SendLogExecute()
data << uint32(count1); // count1 (effect count?)
for(uint32 i = 0; i < count1; ++i)
{
data << uint32(m_spellInfo->Effect[0]); // spell effect
data << uint32(m_spellInfo->Effect[EFFECT_INDEX_0]);// spell effect
uint32 count2 = 1;
data << uint32(count2); // count2 (target count?)
for(uint32 j = 0; j < count2; ++j)
{
switch(m_spellInfo->Effect[0])
switch(m_spellInfo->Effect[EFFECT_INDEX_0])
{
case SPELL_EFFECT_POWER_DRAIN:
if(Unit *unit = m_targets.getUnitTarget())
@ -3482,7 +3482,7 @@ void Spell::SendLogExecute()
break;
case SPELL_EFFECT_CREATE_ITEM:
case SPELL_EFFECT_CREATE_ITEM_2:
data << uint32(m_spellInfo->EffectItemType[0]);
data << uint32(m_spellInfo->EffectItemType[EFFECT_INDEX_0]);
break;
case SPELL_EFFECT_SUMMON:
case SPELL_EFFECT_TRANS_DOOR:
@ -4040,7 +4040,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if( m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->isMoving() )
{
// skip stuck spell to allow use it in falling case and apply spell limitations at movement
if( (!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR) || m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK) &&
if( (!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR) || m_spellInfo->Effect[EFFECT_INDEX_0] != SPELL_EFFECT_STUCK) &&
(IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0) )
return SPELL_FAILED_MOVING;
}
@ -4113,7 +4113,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// If 0 spell effect empty - client not send target data (need use selection)
// TODO: check it on next client version
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[1] == TARGET_CHAIN_DAMAGE)
m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE)
{
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
m_targets.setUnitTarget(target);