Remove unnecessary double equals from configure.ac.
[xboard.git] / moves.c
diff --git a/moves.c b/moves.c
index 8380f1b..af04d1e 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -1223,12 +1223,16 @@ void DisambiguateCallback(board, flags, kind, rf, ff, rt, ft, closure)
        (cl->ftIn == -1 || cl->ftIn == ft || wildCard)) {
 
        cl->count++;
-        cl->piece = board[rf][ff];
-       cl->rf = rf;
-       cl->ff = ff;
-       cl->rt = wildCard ? cl->rtIn : rt;
-       cl->ft = wildCard ? cl->ftIn : ft;
-       cl->kind = kind;
+       if(cl->count == 1 || board[rt][ft] != EmptySquare) {
+         // [HGM] oneclick: if multiple moves, be sure we remember capture
+         cl->piece = board[rf][ff];
+         cl->rf = rf;
+         cl->ff = ff;
+         cl->rt = wildCard ? cl->rtIn : rt;
+         cl->ft = wildCard ? cl->ftIn : ft;
+         cl->kind = kind;
+       }
+       cl->captures += (board[cl->rt][cl->ft] != EmptySquare); // [HGM] oneclick: count captures
     }
 }
 
@@ -1239,7 +1243,7 @@ void Disambiguate(board, flags, closure)
 {
     int illegal = 0; char c = closure->promoCharIn;
 
-    closure->count = 0;
+    closure->count = closure->captures = 0;
     closure->rf = closure->ff = closure->rt = closure->ft = 0;
     closure->kind = ImpossibleMove;
     if (appData.debugMode) {