Draw stops working after if
<p>I'm trying to create a maze with Union Find, but am unable to remove walls.
This is what I have got so far.</p>

<pre><code> private void createMaze (int cells, Graphics g) {
     s = new int[cells*cells]; //No unions yet setting all to -1
     for(int i = 0; i &lt; cells*cells; ++i){
         s[i] = -1;
     }
     g.setColor(Color.yellow);
     random = new Random();

     while(breaker){
         g.setColor(Color.yellow);
         int innerWall = random.nextInt(4)+0;
         int randomCellX = random.nextInt(cells-1)+0;
         int randomCellY = random.nextInt(cells)+0;

         if(randomCellX==cells&amp;&amp;innerWall==2||
            randomCellX==0&amp;&amp;innerWall==0||
            randomCellY==cells-1&amp;&amp;innerWall==3||
            randomCellY==0&amp;&amp;innerWall==1){
             continue; 
         }           
         else{

             int location = randomCellX+(randomCellY*cells);
             int neighbour = 0;
             if(innerWall==0){
                 neighbour =location-1;
             }
             else if(innerWall==1){
                 neighbour =location-cells;
             }
             else if(innerWall==2){
                 neighbour =location+1;
             }
             else if(innerWall==3){
                 neighbour =location+cells;
             }
             int locationRoot =find(location);
             int neighbourRoot =find(neighbour);

             if(locationRoot==neighbourRoot){
                 breaker = checkIfDone(s);
                }
             union(location,neighbour);
             drawWall(randomCellX,randomCellY,innerWall,g);


         }


     }
}
</code></pre>

<p>If I remove the</p>

<pre><code>if(randomCellX==cells&amp;&amp;innerWall==2||
            randomCellX==0&amp;&amp;innerWall==0||
            randomCellY==cells-1&amp;&amp;innerWall==3||
            randomCellY==0&amp;&amp;innerWall==1){
             continue; 
         }
</code></pre>

<p>It removes the lines fine,but when it is added the walls are not removed. The method is called but doesn't do anything.</p>