summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c3fb2ac)
For e.p. the to-Square of the Pawn has to be clicked. Promotions are
always to Queen when you click the to-square, but use the promotion
pop-up when you click the from-square.
setboardSpoiledMachineBlack = 0; /* [HGM] assume WB 4.2.7 already solves this after sending setboard */
}
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)
{
int
HasPromotionChoice(int fromX, int fromY, int toX, int toY, char *promoChoice)
{
*promoChoice = PieceToChar(BlackFerz); // no choice
return FALSE;
}
*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);
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);
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;
fromX = cl.ff;
fromY = cl.rf;
*x = cl.ft;
cl.ftIn = *x;
cl.promoCharIn = NULLCHAR;
Disambiguate(boards[currentMove], PosFlags(currentMove), &cl);
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;
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;
return TRUE;
}
return FALSE;
|| x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) )
return;
|| x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) )
return;
+ autoQueen = appData.alwaysPromoteToQueen;
+
if (fromX == -1) {
if(!appData.oneClick || !OnlyMove(&x, &y)) {
if (clickType == Press) {
if (fromX == -1) {
if(!appData.oneClick || !OnlyMove(&x, &y)) {
if (clickType == Press) {