mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[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:
parent
49881d4215
commit
d560503a03
3 changed files with 20 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue