X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=05af22bd8201f75fb9718382a3307eda68d5e976;hb=84786e5f06126838b5a38acc7fe7f8758ec44422;hp=b739ed0f05fbccd58bd97354352e630d82352304;hpb=0db7cb3a6d76078255f3d19cb8364ce3dc536458;p=xboard.git diff --git a/xboard.c b/xboard.c index b739ed0..05af22b 100644 --- a/xboard.c +++ b/xboard.c @@ -1229,6 +1229,9 @@ XtResource clientResources[] = { { "adjudicateLossThreshold", "adjudicateLossThreshold", XtRInt, sizeof(int), XtOffset(AppDataPtr, adjudicateLossThreshold), XtRImmediate, (XtPointer) 0}, + { "adjudicateDrawMoves", "adjudicateDrawMoves", XtRInt, + sizeof(int), XtOffset(AppDataPtr, adjudicateDrawMoves), + XtRImmediate, (XtPointer) 0}, { "pgnEventHeader", "pgnEventHeader", XtRString, sizeof(String), XtOffset(AppDataPtr, pgnEventHeader), XtRImmediate, (XtPointer) "Computer Chess Game" }, @@ -1697,6 +1700,7 @@ XrmOptionDescRec shellOptions[] = { { "-pgnExtendedInfo", "pgnExtendedInfo", XrmoptionSepArg, NULL }, { "-hideThinkingFromHuman", "hideThinkingFromHuman", XrmoptionSepArg, NULL }, { "-adjudicateLossThreshold", "adjudicateLossThreshold", XrmoptionSepArg, NULL }, + { "-adjudicateDrawMoves", "adjudicateDrawMoves", XrmoptionSepArg, NULL }, { "-pgnEventHeader", "pgnEventHeader", XrmoptionSepArg, NULL }, { "-firstIsUCI", "firstIsUCI", XrmoptionSepArg, NULL }, { "-secondIsUCI", "secondIsUCI", XrmoptionSepArg, NULL }, @@ -5140,14 +5144,18 @@ void HandleUserMove(w, event, prms, nprms) x >= 0 && y >= 0) { ChessSquare fromP; ChessSquare toP; + int frc; /* Check if clicking again on the same color piece */ fromP = boards[currentMove][fromY][fromX]; toP = boards[currentMove][y][x]; - if ((WhitePawn <= fromP && fromP < WhiteKing && // [HGM] this test should go, as UserMoveTest now does it. - WhitePawn <= toP && toP <= WhiteKing) || // For now I made it less critical by exempting King - (BlackPawn <= fromP && fromP < BlackKing && // moves, to not interfere with FRC castlings. - BlackPawn <= toP && toP <= BlackKing)) { + frc = gameInfo.variant == VariantFischeRandom || gameInfo.variant == VariantCapaRandom; + if ((WhitePawn <= fromP && fromP <= WhiteKing && // [HGM] this test should go, as UserMoveTest now does it. + WhitePawn <= toP && toP <= WhiteKing && + !(fromP == WhiteKing && toP == WhiteRook && frc)) || + (BlackPawn <= fromP && fromP <= BlackKing && + BlackPawn <= toP && toP <= BlackKing && + !(fromP == BlackKing && toP == BlackRook && frc))) { /* Clicked again on same color piece -- changed his mind */ second = (x == fromX && y == fromY); if (appData.highlightDragging) {