[10819] Fixed creature's speed recalculation, forgotten DB speed mods are used now

Also properly update speeds at creature entry change(in case there are aura speed bonuses), thanks to Vladimir for pointing
This commit is contained in:
SilverIce 2010-12-03 04:11:52 +02:00
parent 49881d4215
commit d560503a03
3 changed files with 20 additions and 5 deletions

View file

@ -8250,6 +8250,22 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio)
if (speed < min_speed)
speed = min_speed;
}
if (GetTypeId() == TYPEID_UNIT)
{
switch(mtype)
{
case MOVE_RUN:
speed *= ((Creature*)this)->GetCreatureInfo()->speed_run;
break;
case MOVE_WALK:
speed *= ((Creature*)this)->GetCreatureInfo()->speed_walk;
break;
default:
break;
}
}
SetSpeedRate(mtype, speed * ratio, forced);
}