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
-19
View File
@@ -325,25 +325,6 @@ namespace Game.Entities
return Math.Abs(Math.Sin(angle)) * GetExactDist2d(pos.GetPositionX(), pos.GetPositionY()) < width;
}
public void GetSinCos(float x, float y, out float vsin, out float vcos)
{
float dx = GetPositionX() - x;
float dy = GetPositionY() - y;
if (Math.Abs(dx) < 0.001f && Math.Abs(dy) < 0.001f)
{
float o = NormalizeOrientation(GetOrientation() - MathF.PI);
vcos = MathF.Cos(o);
vsin = MathF.Sin(o);
}
else
{
float dist = (float)Math.Sqrt((dx * dx) + (dy * dy));
vcos = dx / dist;
vsin = dy / dist;
}
}
public override string ToString()
{
return $"X: {posX} Y: {posY} Z: {posZ} O: {Orientation}";