From f87e38c6a6e20a385497aa947987a731baf5aedb Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 13 Mar 2011 14:09:14 +0100 Subject: [PATCH] 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. --- parser.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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 } } -- 1.7.0.4