From 402a6354e0c004064de6ab524d3b2ae36e9732cb Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 5 Jul 2009 19:21:55 +0200 Subject: *Correctl update speed rate of creatures - original patch by smellbee. --HG-- branch : trunk --- src/game/Unit.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index fbd9698f494..10867f501c1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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)) -- cgit v1.2.3