From: H.G.Muller Date: Wed, 25 Nov 2015 18:26:54 +0000 (+0100) Subject: Allow skipping over black squares X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=4d13e321177f50fb53e4cec3335c9d3966c88308 Allow skipping over black squares 'Skip pieces', defined with a 'j' prefix on a slider(asopposedto rider), which skip the first square(s)of their path irrespective of occupation should also be able to skip over holes in the board. --- diff --git a/moves.c b/moves.c index b5b6ffe..1e9ba9e 100644 --- a/moves.c +++ b/moves.c @@ -408,8 +408,8 @@ MovesFromString (Board board, int flags, int f, int r, int tx, int ty, int angle if(y < 0 || y >= BOARD_HEIGHT) break; // vertically off-board: always done if(x < BOARD_LEFT) { if(mode & 128) x += BOARD_RGHT - BOARD_LEFT, loop++; else break; } if(x >= BOARD_RGHT) { if(mode & 128) x -= BOARD_RGHT - BOARD_LEFT, loop++; else break; } - if(board[y][x] == DarkSquare) break; // black squares are supposed to be off board if(j) { j--; continue; } // skip irrespective of occupation + if(board[y][x] == DarkSquare) break; // black squares are supposed to be off board if(!jump && board[y - vy + vy/2][x - vx + vx/2] != EmptySquare) break; // blocked if(jump > 1 && board[y - vy + vy/2][x - vx + vx/2] == EmptySquare) break; // no hop if(x == f && y == r && !loop) occup = 4; else // start square counts as empty (if not around cylinder!)