fBaseXtensions.Navigation.Navigation.AttemptFindSafeSpot C# (CSharp) Method

AttemptFindSafeSpot() public method

Searches for a safespot
public AttemptFindSafeSpot ( System.Vector3 &safespot, System.Vector3 LOS, PointCheckingFlags flags ) : bool
safespot System.Vector3
LOS System.Vector3
flags PointCheckingFlags
return bool
        public bool AttemptFindSafeSpot(out Vector3 safespot, Vector3 LOS, PointCheckingFlags flags)
        {
            safespot = vlastSafeSpot;

            Vector3 BotPosition = FunkyGame.Hero.Position;

            //Recreate the entire area?
            if (!CurrentAreaValid())
                CurrentGPArea = new GPArea(BotPosition);

            //Check Bot Navigationally blocked
            RefreshNavigationBlocked();
            if (BotIsNavigationallyBlocked)
            {
                return false;
            }

            //Recreate Bot Current rect?
            //if (CurrentLocationGPrect == null || CurrentLocationGPrect.centerpoint != FunkyGame.Hero.PointPosition)
            //{
            //	FunkyGame.Navigation.CurrentLocationGPrect = new GPRectangle(BotPosition);
            //	//Refresh boundary (blocked directions)
            //	currentLocationBoundary = new AreaBoundary(BotPosition);
            //	UpdateLocationsBlocked();
            //}

            // FunkyGame.Navigation.CurrentLocationGPRect.UpdateObjectCount();

            safespot = CurrentGPArea.AttemptFindSafeSpot(BotPosition, LOS, flags);
            return (safespot != Vector3.Zero);
        }