From 95a02680cade9b041f91d9e5124b5c4436807ab5 Mon Sep 17 00:00:00 2001 From: jeefo Date: Mon, 3 Aug 2015 00:31:37 +0300 Subject: [PATCH] fixed FindNearest() default value to use with squared length's --- include/core.h | 2 +- source/navigate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/core.h b/include/core.h index 8a9f2bf..dc3be06 100644 --- a/include/core.h +++ b/include/core.h @@ -1502,7 +1502,7 @@ public: int GetFacingIndex (void); int FindFarest (const Vector &origin, float maxDistance = 32.0); - int FindNearest (const Vector &origin, float minDistance = 9999.0, int flags = -1); + int FindNearest (const Vector &origin, float minDistance = 99999999.0f, int flags = -1); void FindInRadius (Array &radiusHolder, float radius, const Vector &origin, int maxCount = -1); void Add (int flags, const Vector &waypointOrigin = nullvec); diff --git a/source/navigate.cpp b/source/navigate.cpp index 7c4f3ee..b901ab4 100644 --- a/source/navigate.cpp +++ b/source/navigate.cpp @@ -168,7 +168,7 @@ TacticChoosen: // force bomber to select closest goal, if round-start goal was reset by something if (m_hasC4 && g_timeRoundStart + 20.0f < GetWorldTime ()) { - float minDist = 999999.0f; + float minDist = 99999999.0f; int count = 0; for (int i = 0; i < g_numWaypoints; i++)