Core/Movement: Corrected values sent in knockback packet when speedXY < 0

Port From (https://github.com/TrinityCore/TrinityCore/commit/732a8ee26199d7f04c692fa64f96955db13cf69d)
This commit is contained in:
hondacrx
2021-11-08 10:44:57 -05:00
parent 5f0af0e527
commit 80d6b08c13
5 changed files with 19 additions and 31 deletions
+5 -5
View File
@@ -4021,18 +4021,18 @@ namespace Game.Spells
if (speedxy < 0.01f && speedz < 0.01f)
return;
float x, y;
Position origin;
if (effectInfo.Effect == SpellEffectName.KnockBackDest)
{
if (m_targets.HasDst())
destTarget.GetPosition(out x, out y);
origin = new(destTarget.GetPosition());
else
return;
}
else //if (GetEffect(i].Effect == SPELL_EFFECT_KNOCK_BACK)
m_caster.GetPosition(out x, out y);
else //if (effectInfo.Effect == SPELL_EFFECT_KNOCK_BACK)
origin = new(m_caster.GetPosition());
unitTarget.KnockbackFrom(x, y, speedxy, speedz);
unitTarget.KnockbackFrom(origin, speedxy, speedz);
}
[SpellEffectHandler(SpellEffectName.LeapBack)]