TrinityCore/TrinityCore — Issue #4169: [Spell] Wings of the Damned
Author: Moriquendu
Created: 2011-12-02 06:49:27+00:00
State: open

Hello,

There seems to be a slight bug, with handling of spell auras 305 (SPELL_AURA_MOD_MINIMUM_SPEED)

Right now, the code states:
if (float minSpeedMod = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MINIMUM_SPEED))
{
float min_speed = minSpeedMod / 100.0f;
if (speed < min_speed)
speed = min_speed;
}
The point is, the value of the "Minimum speed" is taken as an absolute value, instead of as value relative to the unit's base speed.

ie. If we have two units,
unit A with base speed 1.0,
unit B with base speed 0.6,

And we apply a -70% slow to both of them,

unit A will be slowed only by 50% ( down to 0.5 ), which is correct, but
unit B will be slowed down to 0.5, instead of 50% of 0.6 ( 50% of base speed ).

How to quickly test in practice:
Place unit A and unit B, apply a slow debuff on both of them ( ie. Cone of Cold ), observe how they both run at same speed.

Note: I'm not 100% about correct expected behaviour, couldn't verify for or against it.
The line
float min_speed = minSpeedMod / 100.0f;
could use changing to
float min_speed = (minSpeedMod / 100.0f) * baseSpeed;
With regards to the proper base speed of a given move type, the unit type, et caetera.

Thank you.