X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=a5ec9559293c79bd1fbd5301f35bffe192c6a70f;hb=6487eb595b4ee51f8eab706698333e57c5dc4ff8;hp=3205d2f0b5d8498442d1abad6c95b50cbe88361e;hpb=981710835fb91625593928380d26952642118781;p=xboard.git diff --git a/moves.c b/moves.c index 3205d2f..a5ec955 100644 --- a/moves.c +++ b/moves.c @@ -1179,6 +1179,12 @@ GenPseudoLegal (Board board, int flags, MoveCallback callback, VOIDSTAR closure, case WhiteFerz: case BlackFerz: + if(gameInfo.variant == VariantXiangqi && ff != BOARD_WIDTH>>1) { + int rt = (piece == BlackFerz ? BOARD_HEIGHT-2 : 1); + int ft = BOARD_WIDTH>>1; + if(!SameColor(board[rf][ff], board[rt][ft])) + callback(board, flags, NormalMove, rf, ff, rt, ft, closure); + } else /* [HGM] support Shatranj pieces */ Ferz(board, flags, rf, ff, callback, closure); break; @@ -2047,7 +2053,7 @@ DisambiguateCallback (Board board, int flags, ChessMove kind, int rf, int ff, in // [HGM] wild: for wild-card pieces rt and rf are dummies if(piece == WhiteFalcon || piece == BlackFalcon || piece == WhiteCobra || piece == BlackCobra) - wildCard = TRUE; + wildCard = !pieceDefs; // no wildcards when engine defined pieces if ((cl->pieceIn == EmptySquare || cl->pieceIn == board[rf][ff] || PieceToChar(board[rf][ff]) == '~' @@ -2131,7 +2137,7 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) return; } } - } else if(pieceDefs && closure->count > 1) { // [HGM] gen: move is ambiguous under engine-defined rules + } else if(pieceDefs && closure->count > 1 && closure->rtIn >=0) { // [HGM] gen: move is ambiguous under engine-defined rules (and not one-click) DisambiguateClosure spare = *closure; pieceDefs = FALSE; spare.count = 0; // See if the (erroneous) built-in rules would resolve that GenLegal(board, flags, DisambiguateCallback, (VOIDSTAR) &spare, closure->pieceIn);