}
Boolean
-OnlyMove(int *x, int *y) {
+OnlyMove(int *x, int *y, Boolean captures) {
DisambiguateClosure cl;
if (appData.zippyPlay) return FALSE;
switch(gameMode) {
cl.promoCharIn = NULLCHAR;
Disambiguate(boards[currentMove], PosFlags(currentMove), &cl);
if( cl.kind == NormalMove ||
+ cl.kind == AmbiguousMove && captures && cl.captures == 1 ||
cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen ||
cl.kind == WhitePromotionKnight || cl.kind == BlackPromotionKnight ||
cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) {
cl.promoCharIn = NULLCHAR;
Disambiguate(boards[currentMove], PosFlags(currentMove), &cl);
if( cl.kind == NormalMove ||
+ cl.kind == AmbiguousMove && captures && cl.captures == 1 ||
cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen ||
cl.kind == WhitePromotionKnight || cl.kind == BlackPromotionKnight ||
cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) {
autoQueen = appData.alwaysPromoteToQueen;
if (fromX == -1) {
- if(!appData.oneClick || !OnlyMove(&x, &y)) {
+ if(!appData.oneClick || !OnlyMove(&x, &y, FALSE)) {
if (clickType == Press) {
/* First square */
if (OKToStartUserMove(x, y)) {
!(fromP == BlackKing && toP == BlackRook && frc))) {
/* Clicked again on same color piece -- changed his mind */
second = (x == fromX && y == fromY);
+ if(!second || !OnlyMove(&x, &y, TRUE)) {
if (appData.highlightDragging) {
SetHighlights(x, y, -1, -1);
} else {
DragPieceBegin(xPix, yPix);
}
return;
+ }
}
// ignore clicks on holdings
if(x < BOARD_LEFT || x >= BOARD_RGHT) return;
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
}
}
{
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) {