X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=83034f4de42b57cdf7331f76ee399aa8cf664d20;hb=fd4699c26227714b63219850485e381be150f3dd;hp=55cb25364cc37d5ffc4048596fd5beb86f29884e;hpb=3d9fcd78798d728341a7a41b19fefd5a24ed46d0;p=xboard.git diff --git a/backend.c b/backend.c index 55cb253..83034f4 100644 --- a/backend.c +++ b/backend.c @@ -7915,6 +7915,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) DisplayMessage("Click in holdings to choose piece", ""); return; } + DrawPosition(FALSE, NULL); // shows piece on from-square during promo popup PromotionPopUp(promoChoice); } else { int oldMove = currentMove; @@ -9145,10 +9146,10 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h } if(sscanf(message, "piece %s %s", buf2, buf1) == 2) { ChessSquare piece = WhitePawn; - char *p=message+6, *q, *s = SUFFIXES, ID = *p; - if(*p == '+') piece = CHUPROMOTED(WhitePawn), ID = *++p; + char *p=message+6, *q, *s = SUFFIXES, ID = *p, promoted = 0; + if(*p == '+') promoted++, ID = *++p; if(q = strchr(s, p[1])) ID += 64*(q - s + 1), p++; - piece += CharToPiece(ID & 255) - WhitePawn; + piece = CharToPiece(ID & 255); if(promoted) piece = CHUPROMOTED(piece); if(cps != &first || appData.testLegality && *engineVariant == NULLCHAR /* always accept definition of */ && piece != WhiteFalcon && piece != BlackFalcon /* wild-card pieces. */ && piece != WhiteCobra && piece != BlackCobra