protected MyBehaviorTreeState FindRandomSafeLocation([BTIn] ref MyBBMemoryTarget inTargetEnemy, [BTOut] ref MyBBMemoryTarget outTargetLocation)
        {
            if (inTargetEnemy == null || !inTargetEnemy.EntityId.HasValue)
            {
                return(MyBehaviorTreeState.FAILURE);
            }
            MyEntity targetEntity = null;

            if (MyEntities.TryGetEntityById(inTargetEnemy.EntityId.Value, out targetEntity))
            {
                Vector3D botPosition    = m_bot.AgentEntity.PositionComp.GetPosition();
                Vector3D directionToBot = botPosition - targetEntity.PositionComp.GetPosition();
                directionToBot.Normalize();

                Vector3D safeLocation = default(Vector3D);
                if (!AiTargetBase.GetRandomDirectedPosition(botPosition, directionToBot, out safeLocation))
                {
                    safeLocation = botPosition + directionToBot * 30;
                }

                MyBBMemoryTarget.SetTargetPosition(ref outTargetLocation, safeLocation);
                return(MyBehaviorTreeState.SUCCESS);
            }
            else
            {
                return(MyBehaviorTreeState.FAILURE);
            }
        }