Fix of double-Q-sac fix
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 18 Feb 2018 19:08:02 +0000 (20:08 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 18 Feb 2018 19:08:02 +0000 (20:08 +0100)
The Queen is piece #4 instead of 5.

dropper.c

index 5d66783..41c4ac8 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -576,7 +576,7 @@ GameInit (char *name)
     for(i=16,ip++; *ip >= 0; i++) pieceValues[WHITE+i] = pieceValues[BLACK+i] = *ip++; // promoted
     for(i=0, ip++; *ip >= 0; i++) handVal[WHITE+i] = handVal[BLACK+i] = *ip++;         // in hand
     pawn = 2*handVal[WHITE] << 20; // used for detection of material-loosing loop
-    queen = v ? 0 : 2*handVal[WHITE+5] << 20; // losing two Queens overflows
+    queen = v ? 0 : 2*handVal[WHITE+4] << 20; // losing two Queens overflows
     for(i=0; i<16; i++) {
        int demoted = dropType[handSlot[WHITE+i+16]]-1; // piece type after demotion (could be Pawn, in Chess)
        handVal[WHITE+i+16] = handVal[BLACK+i+16] = pieceValues[WHITE+i+16] + handVal[demoted];   // gain by capturing promoted piece