Put promo-suffix on ICS move in variant seirawan castlings
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 30 Nov 2011 14:38:21 +0000 (15:38 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Wed, 30 Nov 2011 14:38:21 +0000 (15:38 +0100)
The distinction upper-case / lowercase determines gating at R / K

backend.c

index 4d4b6fa..14cdf0c 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -4952,6 +4952,11 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar)
      char promoChar;
 {
     char user_move[MSG_SIZ];
+    char suffix[4];
+
+    if(gameInfo.variant == VariantSChess && promoChar)
+       snprintf(suffix, 4, "=%c", toX == BOARD_WIDTH<<1 ? ToUpper(promoChar) : ToLower(promoChar));
+    else suffix[0] = NULLCHAR;
 
     switch (moveType) {
       default:
@@ -4967,7 +4972,7 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar)
       case WhiteHSideCastleFR:
       case BlackHSideCastleFR:
       /* POP Fabien */
-       snprintf(user_move, MSG_SIZ, "o-o\n");
+       snprintf(user_move, MSG_SIZ, "o-o%s\n", suffix);
        break;
       case WhiteQueenSideCastle:
       case BlackQueenSideCastle:
@@ -4977,7 +4982,7 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar)
       case WhiteASideCastleFR:
       case BlackASideCastleFR:
       /* POP Fabien */
-       snprintf(user_move, MSG_SIZ, "o-o-o\n");
+       snprintf(user_move, MSG_SIZ, "o-o-o%s\n",suffix);
        break;
       case WhiteNonPromotion:
       case BlackNonPromotion: