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);
}