Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -19,19 +19,26 @@ namespace Server.Misc
public static Point2D ArcPoint(Point3D loc, int radius, int angle)
{
int sideA, sideB;
if (angle < 0)
angle = 0;
if (angle > 90)
angle = 90;
int sideA = (int)Math.Round(radius * Math.Sin(DegreesToRadians(angle)));
int sideB = (int)Math.Round(radius * Math.Cos(DegreesToRadians(angle)));
sideA = (int)Math.Round(radius * Math.Sin(DegreesToRadians(angle)));
sideB = (int)Math.Round(radius * Math.Cos(DegreesToRadians(angle)));
return new Point2D(loc.X - sideB, loc.Y - sideA);
}
public static void Circle2D(Point3D loc, Map map, int radius, DoEffect_Callback effect, int angleStart = 0, int angleEnd = 360)
public static void Circle2D(Point3D loc, Map map, int radius, DoEffect_Callback effect)
{
Circle2D(loc, map, radius, effect, 0, 360);
}
public static void Circle2D(Point3D loc, Map map, int radius, DoEffect_Callback effect, int angleStart, int angleEnd)
{
if (angleStart < 0 || angleStart > 360)
angleStart = 0;
@ -140,9 +147,13 @@ namespace Server.Misc
withinBounds = false;
}
else if (pointQuadrant == start.Quadrant && (x < startX || y > startY))
{
withinBounds = false;
}
else if (pointQuadrant == end.Quadrant && (x > endX || y < endY))
{
withinBounds = false;
}
return opposite ? !withinBounds : withinBounds;
}
@ -207,4 +218,4 @@ namespace Server.Misc
public int Quadrant{ get; }
}
}
}
}