Magic numbers cleanup:
- Replace many magic numbers with constants - Use enum for vehicle flags/seat flags - Correct structure for ItemRandomSuffixEntry --HG-- branch : trunk
This commit is contained in:
@@ -252,7 +252,7 @@ inline float GetSpellMaxRange(uint32 id, bool positive)
|
||||
|
||||
inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
|
||||
{
|
||||
for (int i= 0; i < 3; ++i)
|
||||
for (int i= 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (SpellEffects(spellInfo->Effect[i]) == effect)
|
||||
return true;
|
||||
return false;
|
||||
@@ -260,7 +260,7 @@ inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
|
||||
|
||||
inline bool IsSpellHaveAura(SpellEntry const *spellInfo, AuraType aura)
|
||||
{
|
||||
for (int i= 0; i < 3; ++i)
|
||||
for (int i= 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (AuraType(spellInfo->EffectApplyAuraName[i]) == aura)
|
||||
return true;
|
||||
return false;
|
||||
@@ -386,7 +386,7 @@ inline bool IsPositionTarget(uint32 target)
|
||||
|
||||
inline bool IsSpellWithCasterSourceTargetsOnly(SpellEntry const* spellInfo)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
uint32 targetA = spellInfo->EffectImplicitTargetA[i];
|
||||
if (targetA && !IsCasterSourceTarget(targetA))
|
||||
@@ -518,7 +518,7 @@ inline uint32 GetAllSpellMechanicMask(SpellEntry const* spellInfo)
|
||||
uint32 mask = 0;
|
||||
if (spellInfo->Mechanic)
|
||||
mask |= 1<<spellInfo->Mechanic;
|
||||
for (int i=0; i< 3; ++i)
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (spellInfo->Effect[i] && spellInfo->EffectMechanic[i])
|
||||
mask |= 1<<spellInfo->EffectMechanic[i];
|
||||
return mask;
|
||||
@@ -1352,7 +1352,7 @@ class SpellMgr
|
||||
|
||||
inline bool IsSpellWithCasterSourceTargetsOnly(SpellEntry const* spellInfo)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (uint32 target = spellInfo->EffectImplicitTargetA[i])
|
||||
if (!IsCasterSourceTarget(target))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user