X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=moves.c;h=a6b066b5fbdbe4bdeb488e74ff53c8a02e68a6a0;hp=64615836afef9a7aa2e43a2b2ee0e1da293a96d7;hb=d81f573a5e990af8eb8de5efdea8aa156aa97c1e;hpb=22be362b5abb0d3993d75763fda5112b47287cca diff --git a/moves.c b/moves.c index 6461583..a6b066b 100644 --- a/moves.c +++ b/moves.c @@ -2401,9 +2401,9 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p ((ff == BOARD_WIDTH>>1 && (ft == BOARD_LEFT+2 || ft == BOARD_RGHT-2)) || (ff == (BOARD_WIDTH-1)>>1 && (ft == BOARD_LEFT+1 || ft == BOARD_RGHT-3)))) { if(ft==BOARD_LEFT+1 || ft==BOARD_RGHT-2) - snprintf(out, MOVE_LEN, "O-O%c%c", promoChar ? '/' : 0, ToUpper(promoChar)); + snprintf(out, MOVE_LEN, "O-O%c%c%c", promoChar ? '/' : 0, ToUpper(promoChar), ff + AAA); else - snprintf(out, MOVE_LEN, "O-O-O%c%c", promoChar ? '/' : 0, ToUpper(promoChar)); + snprintf(out, MOVE_LEN, "O-O-O%c%c%c", promoChar ? '/' : 0, ToUpper(promoChar), ff + AAA); /* This notation is always unambiguous, unless there are kings on both the d and e files, with "wild castling" @@ -2478,8 +2478,15 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p *outp++ = ToUpper(promoChar); } else if (gameInfo.variant == VariantSChess && promoChar) { // and in S-Chess we have gating + ChessSquare victim = board[rt][ft]; + if(piece == WhiteRook && victim == WhiteKing || + piece == BlackRook && victim == BlackKing) { + strncpy(out, "O-O-O", MOVE_LEN); + outp = out + 3 + 2*(ft > ff); + } *outp++ = '/'; *outp++ = ToUpper(promoChar); + if(out[0] == 'O') *outp++ = ff + AAA; } *outp = NULLCHAR; return cl.kind;