Beispiel #1
0
        public async Task MoveToCellInFight(KeyValuePair <short, MoveNode>?node)
        {
            if (_account.State != AccountStates.FIGHTING)
            {
                return;
            }

            if (node == null || node.Value.Value.Path.Reachable.Count == 0)
            {
                return;
            }

            if (node.Value.Key == _account.Game.Fight.PlayedFighter.CellId)
            {
                return;
            }

            // Insert the current cellId
            node.Value.Value.Path.Reachable.Insert(0, _account.Game.Fight.PlayedFighter.CellId);

            await _account.Network.SendMessageAsync(new GameMapMovementRequestMessage((uint)_account.Game.Map.Id,
                                                                                      _pathFinder.CompressPath(node.Value.Value.Path.Reachable)));
        }