public void recoverGoal(GoalDecider goalDecider) {
            Unit.MoveType mt;
            if (cost == CostDecider.ILLEGAL_MOVE
                && unit != null
                && current.getTile() != null
                && dst.getTile() != null
                && goalDecider != null
                && goalDecider.check(unit, path)
                && ((mt = unit.getSimpleMoveType(current.getTile(),
                                                 dst.getTile())).isLegal()
                    || mt == Unit.MoveType.MOVE_NO_ATTACK_CIVILIAN)) {
                // Pretend it finishes the move.
                movesLeft = unit.getInitialMovesLeft();
                turns++;
                cost = PathNode.getCost(turns, movesLeft);
                resetPath();
            }
        }