The heuristic for e.p. capture was such that any non-forward move with
a Pawn to an empty square would delete the piece behind its new location
(Xiangqi exempted). This is now limited to cases where EP_STATUS indicates
that the deleted piece was a Pawn that performed a double-push on the
previous move. (Or if there is unknown EP_STATUS.)
This makes XBoard more generally suitable for use with variants that have
non-conventional Pawn moves (with legality testing off). To guarantee this
will not have any unexpected effects in normal Chess, this patch will only
be active if legality testing is off.
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)
&& (toX != fromX)
&& gameInfo.variant != VariantXiangqi
&& gameInfo.variant != VariantBerolina
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)
&& (toX != fromX)
&& gameInfo.variant != VariantXiangqi
&& gameInfo.variant != VariantBerolina