From 4d13e321177f50fb53e4cec3335c9d3966c88308 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 25 Nov 2015 19:26:54 +0100 Subject: [PATCH] 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. --- moves.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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!) -- 1.7.0.4