Core/Unit: Correct speed calculus when affected by SPELL_AURA_MOD_MINIMUM_SPEED (#18136)
(cherrypicked from 4224259d83c336ef46fa627a8ba0015200a788eb)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- Val'kyr Shadowguard (Icecrown Citadel/Lich King, all 4 difficulties)
|
||||
UPDATE `creature_template` SET `speed_run`=0.642857 WHERE `entry` IN (36609,39120,39121,39122);
|
||||
@@ -8559,7 +8559,11 @@ void Unit::UpdateSpeed(UnitMoveType mtype)
|
||||
|
||||
if (float minSpeedMod = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MINIMUM_SPEED))
|
||||
{
|
||||
float min_speed = minSpeedMod / 100.0f;
|
||||
float baseMinSpeed = 1.0f;
|
||||
if (!GetOwnerGUID().IsPlayer() && !IsHunterPet() && GetTypeId() == TYPEID_UNIT)
|
||||
baseMinSpeed = ToCreature()->GetCreatureTemplate()->speed_run;
|
||||
|
||||
float min_speed = CalculatePct(baseMinSpeed, minSpeedMod);
|
||||
if (speed < min_speed)
|
||||
speed = min_speed;
|
||||
}
|
||||
|
||||
@@ -1436,7 +1436,6 @@ class npc_valkyr_shadowguard : public CreatureScript
|
||||
_events.Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoCast(me, SPELL_WINGS_OF_THE_DAMNED, false);
|
||||
me->SetSpeedRate(MOVE_FLIGHT, 0.642857f);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
|
||||
Reference in New Issue
Block a user