X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=db04b8e23be40db3e3aefd03f356f8378cd94b88;hb=31f98bb9be6f40551d4dd66252c4b4579ecdbe83;hp=cfbecf76145c375ec6c3de8347324f3612c2ea7b;hpb=f2bdbde59c9d7595411bac5bc3a247b5336a3534;p=xboard.git diff --git a/backend.c b/backend.c index cfbecf7..db04b8e 100644 --- a/backend.c +++ b/backend.c @@ -6399,11 +6399,11 @@ SendBoard (ChessProgramState *cps, int moveNum) if ((int) *bp < (int) BlackPawn) { if(j == BOARD_RGHT+1) snprintf(message, MSG_SIZ, "%c@%d\n", PieceToChar(*bp), bp[-1]); - else snprintf(message, MSG_SIZ, "%c%c%c\n", PieceToChar(*bp), AAA + j, ONE + i); + else snprintf(message, MSG_SIZ, "%c%c%d\n", PieceToChar(*bp), AAA + j, ONE + i - '0'); if(message[0] == '+' || message[0] == '~') { - snprintf(message, MSG_SIZ,"%c%c%c+\n", + snprintf(message, MSG_SIZ,"%c%c%d+\n", PieceToChar((ChessSquare)(DEMOTED *bp)), - AAA + j, ONE + i); + AAA + j, ONE + i - '0'); } if(cps->alphaRank) { /* [HGM] shogi: translate coords */ message[1] = BOARD_RGHT - 1 - j + '1'; @@ -6423,12 +6423,12 @@ SendBoard (ChessProgramState *cps, int moveNum) && ((int) *bp >= (int) BlackPawn)) { if(j == BOARD_LEFT-2) snprintf(message, MSG_SIZ, "%c@%d\n", ToUpper(PieceToChar(*bp)), bp[1]); - else snprintf(message,MSG_SIZ, "%c%c%c\n", ToUpper(PieceToChar(*bp)), - AAA + j, ONE + i); + else snprintf(message,MSG_SIZ, "%c%c%d\n", ToUpper(PieceToChar(*bp)), + AAA + j, ONE + i - '0'); if(message[0] == '+' || message[0] == '~') { - snprintf(message, MSG_SIZ,"%c%c%c+\n", + snprintf(message, MSG_SIZ,"%c%c%d+\n", PieceToChar((ChessSquare)(DEMOTED *bp)), - AAA + j, ONE + i); + AAA + j, ONE + i - '0'); } if(cps->alphaRank) { /* [HGM] shogi: translate coords */ message[1] = BOARD_RGHT - 1 - j + '1'; @@ -10115,6 +10115,9 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) } /* End of code added by Tord */ + } else if (pieceDesc[piece] && piece == king && !strchr(pieceDesc[piece], 'O') && strchr(pieceDesc[piece], 'i')) { + board[fromY][fromX] = EmptySquare; // never castle if King has virgin moves defined on it other than castling + board[toY][toX] = piece; } else if (board[fromY][fromX] == king && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ && toY == fromY && toX > fromX+1) {