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:
Shocker committed 2010-09-28 08:21:51 +03:00
1 parent 192e972a59
commit 78803c9f09
44 files changed
+245 -194

No files matched your search

+3 -3
View File
@@ -2742,7 +2742,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
if (!IsPositiveSpell(spell->Id))
{
bool bNegativeAura = false;
for (uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (spell->EffectApplyAuraName[i] != 0)
{
@@ -4191,7 +4191,7 @@ void Unit::RemoveArenaAuras(bool onleave)
{
AuraApplication const * aurApp = iter->second;
Aura const * aura = aurApp->GetBase();
if (!(aura->GetSpellProto()->AttributesEx4 & (1<<21)) // don't remove stances, shadowform, pally/hunter auras
if (!(aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_UNK21) // don't remove stances, shadowform, pally/hunter auras
&& !aura->IsPassive() // don't remove passive auras
&& (!(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable)
&& (aurApp->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave
@@ -11191,7 +11191,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
return true;
}
for (int i=0;i<3;++i)
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately