private void addConditional(Vector addTo, Location loc, int x, int y) {
        int newX = loc.x + x, newY = loc.y + y;
        if (newX < 0 || newX >= grid.length) {
            return;
        }
        if (newY < 0 || newY >= grid[0].length) {
            return;
        }
        if (grid[newX][newY] == Constants.FULL_NON_PASSABLE) {
            return;
        }
        if (isDiagonal(newX, newY)) {
            if (grid[newX][newY] == Constants.DIAGONAL_NON_PASSABLE) {
                return;
            }
        }

        Node newNode = new Node();
        newNode.location = new Location(newX, newY);
        addTo.addElement(newNode);
    }