X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=6ec7be2c89fd380a36a2c3467a0f2fdc01e428ee;hb=2cb8af0d46f997c76c459b8f09f16cae01b0c5b0;hp=bd37f6daf7526652d58244f7c3745db529ce1e2f;hpb=4d3fc238587cf474577210196630a69530cd7c2b;p=xboard.git diff --git a/backend.c b/backend.c index bd37f6d..6ec7be2 100644 --- a/backend.c +++ b/backend.c @@ -8109,7 +8109,7 @@ Adjudicate (ChessProgramState *cps) // most tests only when we understand the game, i.e. legality-checking on if( appData.testLegality ) { /* [HGM] Some more adjudications for obstinate engines */ - int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+1], i; + int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+2], i; static int moveCount = 6; ChessMove result; char *reason = NULL; @@ -8983,7 +8983,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h char *p=buf2, *q, *s = SUFFIXES, ID = *p; if(*p == '+') piece = CHUPROMOTED WhitePawn, ID = *++p; if(q = strchr(s, p[1])) ID += 64*(q - s + 1), p++; - piece += CharToPiece(ID) - WhitePawn; + piece += CharToPiece(ID & 255) - WhitePawn; if(cps != &first || appData.testLegality && *engineVariant == NULLCHAR /* always accept definition of */ && piece != WhiteFalcon && piece != BlackFalcon /* wild-card pieces. */ && piece != WhiteCobra && piece != BlackCobra @@ -8995,7 +8995,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(piece < EmptySquare) { pieceDefs = TRUE; ASSIGN(pieceDesc[piece], buf1); - if(isupper(*p) && p[1] == '&') { ASSIGN(pieceDesc[WHITE_TO_BLACK piece], buf1); } + if((ID & 32) == 0 && p[1] == '&') { ASSIGN(pieceDesc[WHITE_TO_BLACK piece], buf1); } } return; }