[11332] Avoid use direct mechanic names in loop bounds for version portability.

This commit is contained in:
VladimirMangos 2011-04-11 23:57:08 +04:00
parent 16c562b7a0
commit 6f34696350
3 changed files with 5 additions and 2 deletions

View file

@ -1001,6 +1001,9 @@ enum Mechanics
MECHANIC_ENRAGED = 31
};
#define FIRST_MECHANIC 1
#define MAX_MECHANIC 32
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967da6)
#define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK ( \
(1<<(MECHANIC_CHARM -1))|(1<<(MECHANIC_DISORIENTED-1))|(1<<(MECHANIC_FEAR -1))| \

View file

@ -8718,7 +8718,7 @@ int32 Unit::CalculateAuraDuration(SpellEntry const* spellProto, uint32 effectMas
int32 mechanicMod = 0;
uint32 mechanicMask = GetSpellMechanicMask(spellProto, effectMask);
for(int32 mechanic = MECHANIC_CHARM; mechanic <= MECHANIC_ENRAGED; ++mechanic)
for(int32 mechanic = FIRST_MECHANIC; mechanic < MAX_MECHANIC; ++mechanic)
{
if (!(mechanicMask & (1 << (mechanic-1))))
continue;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11331"
#define REVISION_NR "11332"
#endif // __REVISION_NR_H__