This commit is contained in:
INeedBots 2020-10-06 16:03:46 -06:00
parent 18a7758bbf
commit 7534becb9e
2 changed files with 2 additions and 11 deletions

View File

@ -1328,13 +1328,13 @@ nearAnyOfWaypoints(dist, waypoints)
getNearestWaypointOfWaypoints(waypoints)
{
answer = undefined;
closestDist = -1;
closestDist = 999999999999;
for (i = 0; i < waypoints.size; i++)
{
waypoint = waypoints[i];
thisDist = DistanceSquared(self.origin, waypoint.origin);
if (isDefined(answer) && thisDist < closestDist)
if (thisDist > closestDist)
continue;
answer = waypoint;

View File

@ -33,14 +33,5 @@ test()
if (self is_bot())
continue;
myOrg = self.origin;
myOrg = (myOrg[0], myOrg[1], 0);
myAngles = self GetPlayerAngles();
myAngles = (0, myAngles[1], 0);
myVelocity = self GetVelocity();
myVelocity = (myVelocity[0], myVelocity[1], 0);
self sayall(GetConeDot(myOrg + myVelocity, myOrg, myAngles));
}
}