From: H.G. Muller Date: Sun, 13 Feb 2011 11:18:52 +0000 (+0100) Subject: Fix Alfil bug X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a521dad8087bf19c9d4f5dee12ac8f01a5b865df;p=xboard.git 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 --- 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)