X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=2f6a706566c45fb6833ed09786e204e9548c273d;hb=db81713484892dc9ab61b164ccea9b2a8f3bb101;hp=91f0072a2ff7362ce30bccc481176241778d2102;hpb=7cd0052b1919644b72b23993328bfc542a8525d3;p=xboard.git diff --git a/moves.c b/moves.c index 91f0072..2f6a706 100644 --- a/moves.c +++ b/moves.c @@ -1735,6 +1735,8 @@ CheckTest (Board board, int flags, int rf, int ff, int rt, int ft, int enPassant } } + if(PieceToChar(king) == '.') return 0; // never in check if the royal piece does not participate + if (rt >= 0) { if (enPassant) { captured = board[rf][ft]; @@ -2163,6 +2165,11 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) } } 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; + if(gameInfo.variant == VariantXiangqi && closure->pieceIn == EmptySquare && closure->ffIn < 0) { + closure->ffIn = closure->ftIn; //closure->pieceIn = (flags & 1 ? BlackPawn : WhitePawn); // forward Pawn push has priority + Disambiguate(board, flags, closure); + return; + } pieceDefs = FALSE; spare.count = 0; // See if the (erroneous) built-in rules would resolve that GenLegal(board, flags, DisambiguateCallback, (VOIDSTAR) &spare, closure->pieceIn); if(spare.count == 1) *closure = spare; // It does, so use those in stead (game from file saved before gen patch?)