From: H.G.Muller Date: Fri, 22 Jul 2016 07:12:36 +0000 (+0200) Subject: Fix bare King adjudication X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=a70f567b63dafae38af86be07c0cc3112a013cca Fix bare King adjudication The increase of the number of piece types to 66 gave the BlackKing code 131, wich is > 127, so that using a signed char for it makes it < 0. This cause the black King in the adjudication code to be seen as a white piece. When black then checkmates with 2 pieces, only 1 piece is seen (Q), and then assumed to be a bare King! Now the piece value is passed through an (int) to prevent this. --- diff --git a/backend.c b/backend.c index c5d9e9a..48695ad 100644 --- a/backend.c +++ b/backend.c @@ -11672,7 +11672,7 @@ GameEnds (ChessMove result, char *resultDetails, int whosays) && result != GameIsDrawn) { int i, j, k=0, oppoKings = 0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn); for(j=BOARD_LEFT; j= 0 && p <= (int)WhiteKing) k++; oppoKings += (p + color == WhiteKing + BlackPawn - color); }