private static bool NavigateInDirOfBestSample(NPCHumanContext c, NavPointSampler.SampleCount sampleCount, float radius, NavPointSampler.SampleFeatures features, float minRange, float maxRange)
        {
            bool flag;
            List <NavPointSample> navPointSamples = c.AIAgent.RequestNavPointSamplesInCircle(sampleCount, radius, features);

            if (navPointSamples == null)
            {
                return(false);
            }
            List <NavPointSample> .Enumerator enumerator = navPointSamples.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    Vector3 position = (enumerator.Current.Position - c.Position).normalized;
                    Vector3 vector3  = c.Position + (position * minRange) + (position * ((maxRange - minRange) * UnityEngine.Random.@value));
                    if (c.AIAgent.AttackTarget != null && !NavPointSampler.IsValidPointDirectness(vector3, c.Position, c.EnemyPosition))
                    {
                        continue;
                    }
                    NavPointSampler.SampleScoreParams sampleScoreParam = new NavPointSampler.SampleScoreParams()
                    {
                        WaterMaxDepth = c.AIAgent.GetStats.MaxWaterDepth,
                        Agent         = c.AIAgent,
                        Features      = features
                    };
                    NavPointSample navPointSample = NavPointSampler.SamplePoint(vector3, sampleScoreParam);
                    if (Mathf.Approximately(navPointSample.Score, 0f) || Mathf.Approximately(navPointSample.Position.sqrMagnitude, 0f))
                    {
                        continue;
                    }
                    HumanNavigateToOperator.MakeUnstuck(c);
                    vector3 = navPointSample.Position;
                    c.AIAgent.GetNavAgent.destination = vector3;
                    c.Human.SetTargetPathStatus(0.05f);
                    c.AIAgent.SetFact(NPCPlayerApex.Facts.IsMoving, 1, true, false);
                    flag = true;
                    return(flag);
                }
                return(false);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
            return(flag);
        }