Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(InDanger)
- {
- for (int r = (int)crystalRadius; r < 50; r++)
- {
- float sampleAngle = 15;
- for (int i = 0; i < sampleAngle; i++)
- {
- float angle = i / sampleAngle * 2.0f * 2 * (float)System.Math.PI;
- angle = angle + ((2 * (float)System.Math.PI) / sampleAngle) * (float)rand.NextDouble();
- float px = ObjectManager.Me.Position.X + r * (float)System.Math.Cos(angle);
- float py = ObjectManager.Me.Position.Y + r * (float)System.Math.Cos(angle);
- foreach (WoWGameObject obj in objList)
- {
- //float magSquared = (px - obj.Position.X) * (px - obj.Position.X) + (py - obj.Position.Y) * (py - obj.Position.Y);
- float dist = new Vector3(px, px, ObjectManager.Me.Position.Z).DistanceTo(obj.Position);
- if (dist > crystalRadius)
- {
- Logging.Write("Found viable position, px:" + px + " obj.positionx " + obj.Position.X + " dist:" + dist);
- newPos = new Vector3(px, py, ObjectManager.Me.Position.Z);
- foundSafeSpot = true;
- break;
- }
- }
- if (foundSafeSpot)
- break;
- }
- if (foundSafeSpot)
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement