X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.l;h=0e4f898142bf6cd63c2934cdee45e154cc579b6a;hb=88082a3882690efd9ea7d3e01ad9d6dd5f5baf86;hp=accd5700bb5a9d2cc40d16b853b6a60ed8c40e74;hpb=ccc569b6febbb39ba6e7979f0068c04653456059;p=xboard.git diff --git a/parser.l b/parser.l index accd570..0e4f898 100644 --- a/parser.l +++ b/parser.l @@ -251,9 +251,15 @@ extern void CopyBoard P((Board to, Board from)); 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; } @@ -311,19 +317,20 @@ extern void CopyBoard P((Board to, Board from)); 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; } @@ -368,8 +375,7 @@ extern void CopyBoard P((Board to, Board from)); 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) @@ -377,9 +383,7 @@ extern void CopyBoard P((Board to, Board from)); 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; } @@ -552,8 +556,7 @@ extern void CopyBoard P((Board to, Board from)); 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) @@ -746,6 +749,7 @@ extern void CopyBoard P((Board to, Board from)); } } if(PosFlags(0) & F_FRC_TYPE_CASTLING) { + if (WhiteOnMove(yyboardindex)) { ff = initialRights[2]; ft = initialRights[1];