From: H.G. Muller Date: Sun, 13 Mar 2011 13:09:14 +0000 (+0100) Subject: Fix o-o castling in new parser X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=f87e38c6a6e20a385497aa947987a731baf5aedb Fix o-o castling in new parser The non-compliant notation of castling with lower-case 'o' should be preferred over the non-compliant interpretation of moving a Pawn along the o-file. Not doing so breaks ICS play, as ICS use o-o and o-o-o for castling! So an exception is now made for the o-file in the 'fxg' case. --- diff --git a/parser.c b/parser.c index 973d109..7afd348 100644 --- a/parser.c +++ b/parser.c @@ -242,7 +242,8 @@ if(appData.debugMode)fprintf(debugFP, "trial %d,%d,%d,%d type %d%d%d%d\n", coor return ImpossibleMove; // for now treat as invalid } // fxg stuff, but also things like 0-0, 0-1 and 1-0 - if(!piece && type[1] == NOTHING && type[0] == ALPHABETIC && type[2] == ALPHABETIC) { + if(!piece && type[1] == NOTHING && type[0] == ALPHABETIC && type[2] == ALPHABETIC + && (coord[0] != 14 || coord[2] != 14) /* reserve oo for castling! */ ) { piece = 'P'; n = 4; // kludge alert: fake full to-square } }