//if pool is between CurrentPoint and NextPoint then cycle to nextPoint public void CycleToNextIfBehind(WoWGameObject pool) { WoWPoint cp = CurrentPoint; WoWPoint point = GetNextWayPoint(); point = new WoWPoint(point.X - cp.X, point.Y - cp.Y, 0); point.Normalize(); float angle = WoWMathHelper.NormalizeRadian((float)Math.Atan2(point.Y, point.X - 1)); if (WoWMathHelper.IsFacing(CurrentPoint, angle, pool.Location) && CurrentPoint != WayPoints[WayPoints.Count - 1]) { CycleToNextPoint(); } }
//if pool is between CurrentPoint and NextPoint then cycle to nextPoint public void CycleToNextIfBehind(WoWGameObject pool) { WoWPoint cp = CurrentPoint; WoWPoint point = GetNextWayPoint(); point = new WoWPoint(point.X - cp.X, point.Y - cp.Y, 0); point.Normalize(); float angle = WoWMathHelper.NormalizeRadian((float)Math.Atan2(point.Y, point.X - 1)); if (WoWMathHelper.IsFacing(CurrentPoint, angle, pool.Location) && CurrentPoint != WayPoints[WayPoints.Count - 1]) { CycleToNextPoint(); } }