From 89f4b438a9bc3ed2b2b2bd79f22a1a6af06e9bcb Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 24 Sep 2014 21:47:59 +0200 Subject: [PATCH] Fix cross-edge e.p. capture in Cylinder Chess ApplyMove() did not remove the e.p. victim when an edge-crossing e.p. capture was made, because e.p. rights are only set to neighboring files (after checking there is a Pawn there to capture). The e.p. heuristic has now been changed to also assume e.p. on file-changing Pawn moves that span a large number of files, assuming that these will be wrapping moves. Eventually we should change to better e.p. logic that can be integrated with engine-configured move generation, as the current system would fail for any Pawn that captures more than just neighbor ranks. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 749bac9..605940e 100644 --- a/backend.c +++ b/backend.c @@ -10013,7 +10013,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; } else if ((fromY >= BOARD_HEIGHT>>1) - && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality) + && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality || abs(toX - fromX) > 4) && (toX != fromX) && gameInfo.variant != VariantXiangqi && gameInfo.variant != VariantBerolina @@ -10074,7 +10074,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; } else if ((fromY < BOARD_HEIGHT>>1) - && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality) + && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality || abs(toX - fromX) > 4) && (toX != fromX) && gameInfo.variant != VariantXiangqi && gameInfo.variant != VariantBerolina -- 1.7.0.4