Disambiguate was changed to make sure that for ambiguous moves, a
capture would always prevail in the closure, rather than the last move
that happened to be generated. Before, double-clicking a piece would
sometimes plsy a non-capture.
(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
}
}