X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=4cc2f03d6d354ee7ba2071bb2ac48315f51f8aa9;hb=7949d2168ee377694b645dc909f3cb93039588ee;hp=7235caef523b672e647b3ad2d2c004452b92ae3c;hpb=a8b93f610b613be51a65986431e70c92625e340f;p=xboard.git diff --git a/parser.c b/parser.c index 7235cae..4cc2f03 100644 --- a/parser.c +++ b/parser.c @@ -22,6 +22,7 @@ #include "config.h" #include +#include #include #include #include "common.h" @@ -632,8 +633,12 @@ badMove:// we failed to find algebraic move /* ICS wild castling */ ft = castlingType == 1 ? BOARD_LEFT+1 : (gameInfo.variant == VariantJanus ? BOARD_RGHT-2 : BOARD_RGHT-3); } else { + char *q; ff = BOARD_WIDTH>>1; // e-file ft = castlingType == 1 ? BOARD_RGHT-2 : BOARD_LEFT+2; + if(pieceDesc[king] && (q = strchr(pieceDesc[king], 'O'))) { // redefined to non-default King stride + ft = (castlingType == 1 ? ff + atoi(q+1) : ff - atoi(q+1)); + } } if(PosFlags(0) & F_FRC_TYPE_CASTLING) { if (wom) {