piece = boards[yyboardindex]
[currentMoveString[1] - ONE][currentMoveString[0] - AAA];
+ if(PieceToChar(piece) == '+' && appData.icsActive) promoted = 1, yytext[skip3] = PieceToChar(DEMOTED piece); // trust ICS
if(promoted) piece = (ChessSquare) (DEMOTED piece);
c = PieceToChar(piece);
if(c == '~') c = PieceToChar((ChessSquare) (DEMOTED piece));
currentMoveString[4]);
if (currentMoveString[4] == NULLCHAR &&
- (result == WhitePromotionKnight || result == BlackPromotionKnight ||
- result == WhitePromotionQueen || result == BlackPromotionQueen)) {
- currentMoveString[4] = PieceToChar(BlackQueen);
+ (result == WhitePromotion || result == BlackPromotion)) {
+ if(gameInfo.variant == VariantCourier || gameInfo.variant == VariantShatranj)
+ currentMoveString[4] = PieceToChar(BlackFerz);
+ else if(gameInfo.variant == VariantGreat)
+ currentMoveString[4] = PieceToChar(BlackMan);
+ else if(gameInfo.variant == VariantShogi)
+ currentMoveString[4] = '+';
+ else
+ currentMoveString[4] = PieceToChar(BlackQueen);
currentMoveString[5] = NULLCHAR;
}
currentMoveString[4]);
if (currentMoveString[4] == NULLCHAR) {
- if(result == WhitePromotionKnight || result == BlackPromotionKnight ||
- result == WhitePromotionQueen || result == BlackPromotionQueen) {
+ if(result == WhitePromotion || result == BlackPromotion) {
if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)
currentMoveString[4] = PieceToChar(BlackFerz);
else if(gameInfo.variant == VariantGreat)
currentMoveString[4] = PieceToChar(BlackMan);
+ else if(gameInfo.variant == VariantShogi)
+ currentMoveString[4] = '+'; // Queen might not be defined in mini variants!
else
currentMoveString[4] = PieceToChar(BlackQueen);
currentMoveString[5] = NULLCHAR;
}
} else if(appData.testLegality && // strip off unnecessary and false promo characters
- !(result == WhitePromotionQueen || result == BlackPromotionQueen ||
- result == WhiteNonPromotion || result == BlackNonPromotion)) currentMoveString[4] = NULLCHAR;
+ !(result == WhitePromotion || result == BlackPromotion ||
+ result == WhiteNonPromotion || result == BlackNonPromotion)) currentMoveString[4] = NULLCHAR;
return (int) result;
}
currentMoveString[4]);
if (currentMoveString[4] == NULLCHAR &&
- (result == WhitePromotionKnight || result == BlackPromotionKnight ||
- result == WhitePromotionQueen || result == BlackPromotionQueen)) {
+ (result == WhitePromotion || result == BlackPromotion)) {
if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)
currentMoveString[4] = PieceToChar(BlackFerz);
else if(gameInfo.variant == VariantGreat)
else
currentMoveString[4] = PieceToChar(BlackQueen);
currentMoveString[5] = NULLCHAR;
- } else if(appData.testLegality && // strip off unnecessary and false promo characters
- !(result == WhitePromotionQueen || result == BlackPromotionQueen ||
- result == WhiteNonPromotion || result == BlackNonPromotion)) currentMoveString[4] = NULLCHAR;
+ }
return (int) result;
}
currentMoveString[4]);
if (currentMoveString[4] == NULLCHAR &&
- (result == WhitePromotionQueen || result == BlackPromotionQueen ||
- result == WhitePromotionKnight || result == BlackPromotionKnight)) {
+ (result == WhitePromotion || result == BlackPromotion)) {
currentMoveString[4] = PieceToChar(BlackQueen);
// [HGM] shatranj: take care of variants without Queen
if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)
}
}
if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
+
if (WhiteOnMove(yyboardindex)) {
ff = initialRights[2];
ft = initialRights[1];
rf, ff, rt, ft, NULLCHAR);
}
-[A-Z][@*][a-l][0-9] {
+[A-Za-z][@*][a-l][0-9] {
/* Bughouse piece drop. */
currentMoveString[1] = '@';
currentMoveString[2] = yytext[2];