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
2010-09-28 08:21:51 +03:00
parent 192e972a59
commit 78803c9f09
44 changed files with 245 additions and 194 deletions
+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
+2 -2
View File
@@ -681,8 +681,8 @@ enum MovementFlags
enum MovementFlags2
{
MOVEMENTFLAG2_NONE = 0x00000000,
MOVEMENTFLAG2_UNK1 = 0x00000001,
MOVEMENTFLAG2_UNK2 = 0x00000002,
MOVEMENTFLAG2_NO_STRAFE = 0x00000001,
MOVEMENTFLAG2_NO_JUMPING = 0x00000002,
MOVEMENTFLAG2_UNK3 = 0x00000004,
MOVEMENTFLAG2_FULL_SPEED_TURNING = 0x00000008,
MOVEMENTFLAG2_FULL_SPEED_PITCHING = 0x00000010,