X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=1c4fe512582cd5fc1893eefe7480ecb0a0c30e55;hb=fda0f178b9357faee596c04d5e5ceebf47642d9f;hp=5f6aad505effdd17ba34ca051208fef7f4304fe2;hpb=a841d3b604928c71f6d24896e72a818e69d28210;p=xboard.git diff --git a/moves.c b/moves.c index 5f6aad5..1c4fe51 100644 --- a/moves.c +++ b/moves.c @@ -1331,14 +1331,23 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) GenLegal(board, flags|F_IGNORE_CHECK, DisambiguateCallback, (VOIDSTAR) closure, closure->pieceIn); if (closure->count == 0) { /* No, it's not even that */ - if (appData.debugMode) { int i, j; - for(i=BOARD_HEIGHT-1; i>=0; i--) { - for(j=0; jpieceIn != EmptySquare) { + int f, r; // if there is only a single piece of the requested type on the board, use that + closure->rt = closure->rtIn, closure->ft = closure->ftIn; + for(r=0; rpieceIn) closure->count++, closure->rf = r, closure->ff = f; + if(closure->count > 1) illegal = 0; // ambiguous + } + if(closure->count == 0) { + if (appData.debugMode) { int i, j; + for(i=BOARD_HEIGHT-1; i>=0; i--) { + for(j=0; j