From a521dad8087bf19c9d4f5dee12ac8f01a5b865df Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 13 Feb 2011 12:18:52 +0100 Subject: [PATCH] Fix Alfil bug The test for Alfil (suppressing single steps on the Elephant) contained a wrong logical operator, so that it could never be active. It also failed to include Xiangqi as variant with traditional Alfil. This led to one-step moves of the Elephant in these variants, and false check or unreliable mate detections. Fix move of Xiangqi Elephant --- moves.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/moves.c b/moves.c index 769604d..e70df08 100644 --- a/moves.c +++ b/moves.c @@ -419,7 +419,8 @@ void GenPseudoLegal(board, flags, callback, closure) && !SameColor(board[rf][ff], board[rt][ft])) callback(board, flags, NormalMove, rf, ff, rt, ft, closure); - if(gameInfo.variant == VariantShatranj && gameInfo.variant == VariantCourier) continue; // classical Alfil + if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier + || gameInfo.variant == VariantXiangqi) continue; // classical Alfil rt = rf + rs; // in unknown variant we assume Modern Elephant, which can also do one step ft = ff + fs; if (!(rt < 0 || rt >= BOARD_HEIGHT || ft < BOARD_LEFT || ft >= BOARD_RGHT) -- 1.7.0.4