Merge pull request #14250 from xjose93/SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED

Core/Unit: Fix snare/daze immunities versus SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED

Fix SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED modifying speeds of bosses that are immune to changes of speeds.
This commit is contained in:
jackpoz committed 2015-06-14 16:34:49 +02:00
commit 81cec13a58
1 file changed
+7
+7
View File
@@ -12294,6 +12294,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)