From: H.G.Muller Date: Wed, 24 Sep 2014 19:47:59 +0000 (+0200) Subject: Fix cross-edge e.p. capture in Cylinder Chess X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=89f4b438a9bc3ed2b2b2bd79f22a1a6af06e9bcb;p=xboard.git 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. --- 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