From a70f567b63dafae38af86be07c0cc3112a013cca Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Fri, 22 Jul 2016 09:12:36 +0200 Subject: [PATCH] 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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); } -- 1.7.0.4