Fix debris after click-click explosion near board edge
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 May 2016 18:29:37 +0000 (20:29 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 May 2016 18:29:37 +0000 (20:29 +0200)
The redrawn grid was not exposed for board edges a knight's jump
away from an explosion square after a click-click capture in variant
atomic. This was due to the smartness in preventing overlapping
exposures of neighboring square, deferring the task to expose the grid
to squares that were beyond the edge. Now all squares in the explosion
range are exposed including grid.

board.c

diff --git a/board.c b/board.c
index a0ce36e..533e7fb 100644 (file)
--- a/board.c
+++ b/board.c
@@ -641,7 +641,7 @@ again:
   if(Explode(board, fromX, fromY, toX, toY)) { // mark as damaged
     int i,j;
     for(i=0; i<BOARD_WIDTH; i++) for(j=0; j<BOARD_HEIGHT; j++)
-      if((i-toX)*(i-toX) + (j-toY)*(j-toY) < 6) damage[0][j][i] |=  1 + ((i-toX ^ j-toY) & 1);
+      if((i-toX)*(i-toX) + (j-toY)*(j-toY) < 6) damage[0][j][i] |= 2;
   }
 
   /* Be sure end square is redrawn, with piece in it */