Esempio n. 1
0
        private void MoveToPostion()
        {
            _lastMoveResult = NavExtensions.NavigateTo(Position);

            if (_lastMoveResult == MoveResult.PathGenerationFailed)
            {
                Logger.Log("Error moving to offset x={0} y={1} distance={2:0} position={3}", OffsetX, OffsetY, Position.Distance2D(MyPos), Position);
                _isDone = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles actual movement to the Priority Scene
        /// </summary>
        private void MoveToPriorityScene()
        {
            MoveResult moveResult = NavExtensions.NavigateTo(_prioritySceneTarget);

            Logger.Log("Moved to Scene ({0}) {1} - {2} Center {3} Distance {4:0}",
                       moveResult, _currentPriorityScene.Name, _currentPriorityScene.SceneInfo.SNOId, _prioritySceneTarget, _prioritySceneTarget.Distance2D(myPos));


            if (moveResult == MoveResult.Failed || moveResult == MoveResult.PathGenerationFailed)
            {
                Logger.Log("Unable to navigate to Scene ({0}) {1} - {2} Center {3} Distance {4:0}, cancelling!",
                           moveResult, _currentPriorityScene.Name, _currentPriorityScene.SceneInfo.SNOId, _prioritySceneTarget, _prioritySceneTarget.Distance2D(myPos));
                PrioritySceneMoveToFinished();
            }
        }
Esempio n. 3
0
        public MoveResult MoveTo(Vector3 destination, string destinationName = null, bool useRaycast = true, bool useNavigator = false)
        {
            if (!ZetaDia.IsInGame || !ZetaDia.Me.IsValid || ZetaDia.Me.IsDead || ZetaDia.IsLoadingWorld || !ZetaDia.Service.IsValid || !ZetaDia.WorldInfo.IsValid)
            {
                return(MoveResult.Failed);
            }

            try
            {
                return(NavExtensions.NavigateTo(destination, destinationName));
            }
            catch (Exception ex)
            {
                Logger.Log("{0}", ex);
                GridSegmentation.Reset();

                return(MoveResult.Failed);
            }
        }