X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=1c4fe512582cd5fc1893eefe7480ecb0a0c30e55;hb=a0f11c3028eb6f2911a2abfe2496aed6f33207a5;hp=f8b7857af9df0c59976c0947467768c6ed33a8ba;hpb=7fc292a18170994d4213b561a2bdf0fe4aec458b;p=xboard.git diff --git a/moves.c b/moves.c index f8b7857..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.testLegality && closure->pieceIn != 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