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
+2 -2
View File
@@ -656,7 +656,7 @@ namespace Game.Movement
init.Launch();
}
public void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ, SpellEffectExtraData spellEffectExtraData = null)
public void MoveKnockbackFrom(Position origin, float speedXY, float speedZ, SpellEffectExtraData spellEffectExtraData = null)
{
//This function may make players fall below map
if (_owner.IsTypeId(TypeId.Player))
@@ -670,7 +670,7 @@ namespace Game.Movement
float dist = 2 * moveTimeHalf * speedXY;
float max_height = -MoveSpline.ComputeFallElevation(moveTimeHalf, false, -speedZ);
_owner.GetNearPoint(_owner, out x, out y, out z, dist, _owner.GetAbsoluteAngle(srcX, srcY) + MathFunctions.PI);
_owner.GetNearPoint(_owner, out x, out y, out z, dist, _owner.GetAbsoluteAngle(origin) + MathFunctions.PI);
MoveSplineInit init = new(_owner);
init.MoveTo(x, y, z);