Core/Unit: Fix snare/daze immunities versus SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED.

This commit is contained in:
xjose93 committed 2015-06-14 13:45:29 +02:00
1 parent 37298bbc2f
commit 6f2b086048
1 file changed
+7
+7
View File
@@ -12307,6 +12307,13 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
/// @todo possible affect only on MOVE_RUN
if (int32 normalization = GetMaxPositiveAuraModifier(SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED))
{
if (Creature* creature = ToCreature())
{
uint32 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
if (immuneMask & (1 << MECHANIC_SNARE) || immuneMask & (1 << MECHANIC_DAZE))
break;
}
// Use speed from aura
float max_speed = normalization / (IsControlledByPlayer() ? playerBaseMoveSpeed[mtype] : baseMoveSpeed[mtype]);
if (speed > max_speed)