setboardSpoiledMachineBlack = 0; /* [HGM] assume WB 4.2.7 already solves this after sending setboard */
}
+static int autoQueen; // [HGM] oneclick
+
int
HasPromotionChoice(int fromX, int fromY, int toX, int toY, char *promoChoice)
{
*promoChoice = PieceToChar(BlackFerz); // no choice
return FALSE;
}
- if(appData.alwaysPromoteToQueen) { // predetermined
+ if(autoQueen) { // predetermined
if(gameInfo.variant == VariantSuicide || gameInfo.variant == VariantLosers)
*promoChoice = PieceToChar(BlackKing); // in Suicide Q is the last thing we want
else *promoChoice = PieceToChar(BlackQueen);
cl.ftIn = -1;
cl.promoCharIn = NULLCHAR;
Disambiguate(boards[currentMove], PosFlags(currentMove), &cl);
- if(cl.kind == NormalMove) {
+ if( cl.kind == NormalMove ||
+ cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen ||
+ cl.kind == WhitePromotionKnight || cl.kind == BlackPromotionKnight ||
+ cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) {
fromX = cl.ff;
fromY = cl.rf;
*x = cl.ft;
cl.ftIn = *x;
cl.promoCharIn = NULLCHAR;
Disambiguate(boards[currentMove], PosFlags(currentMove), &cl);
- if(cl.kind == NormalMove) {
+ if( cl.kind == NormalMove ||
+ cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen ||
+ cl.kind == WhitePromotionKnight || cl.kind == BlackPromotionKnight ||
+ cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) {
fromX = cl.ff;
fromY = cl.rf;
*x = cl.ft;
*y = cl.rt;
+ autoQueen = TRUE; // act as if autoQueen on when we click to-square
return TRUE;
}
return FALSE;
|| x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) )
return;
+ autoQueen = appData.alwaysPromoteToQueen;
+
if (fromX == -1) {
if(!appData.oneClick || !OnlyMove(&x, &y)) {
if (clickType == Press) {