*Correctl update speed rate of creatures - original patch by smellbee.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-05 19:21:55 +02:00
parent ea7ac26e72
commit 402a6354e0
+5
View File
@@ -10898,6 +10898,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
}
float bonus = non_stack_bonus > stack_bonus ? non_stack_bonus : stack_bonus;
// now we ready for speed calculation
float speed = main_speed_mod ? bonus*(100.0f + main_speed_mod)/100.0f : bonus;
@@ -10907,6 +10908,10 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
case MOVE_SWIM:
case MOVE_FLIGHT:
{
// Set creature speed rate from CreatureInfo
if (GetTypeId() == TYPEID_UNIT)
speed *= ((Creature*)this)->GetCreatureInfo()->speed;
// Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need
// TODO: possible affect only on MOVE_RUN
if(int32 normalization = GetMaxPositiveAuraModifier(SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED))