Beispiel #1
0
 private int GetClosestWP(MainForm.WayPoints[] WP)
 {
     double MinRange = 10000;
     int ClosestIndex = 0;
     for (int i = 0; i < WP.Length; i++)
     {
         double Range = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z);
         if (Range < MinRange)
         {
             ClosestIndex = i;
             MinRange = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z);
         }
     }
     return ClosestIndex;
 }
Beispiel #2
0
 private int GetClosestWP(int CurrentWP, MainForm.Coords[] WP)
 {
     int ClosestIndex = 0;
     double ClosestRange = 10000;
     for (int i = 0; i < WP.Length; i++)
     {
         double p = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z);
         if (p < ClosestRange)
         {
             ClosestIndex = i;
             ClosestRange = WowControl.CheckPoint(WP[CurrentWP].X, WP[CurrentWP].Y, WP[CurrentWP].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z);
         }
     }
     return ClosestIndex;
 }