Make sure no early move generation in null-move reply
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 29 May 2017 15:38:03 +0000 (17:38 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 29 May 2017 15:38:03 +0000 (17:38 +0200)
Now that we explicitly test for pinning of the e.p. victim, early move
generation (to test for King capture) is only needed after King moves.
But the toPiece on which we test this can be undefined after null move.
Rather than explicitly testing for null move when setting earlyGen,
we set toPiece to a Pawn when making the null move.

dropper.c

index 9a7bd00..5a7d54e 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1220,7 +1220,7 @@ if(PATH)printf("      Hit, d=%d, checker = %x\n",entry->depth,f.checker);
        f.mutation = -2; // kludge to suppress testing for discovered check
        f.newEval = f.pstEval;
        f.newKey = f.hashKey;
-       f.epSqr = -1; f.fromSqr = f.toSqr = f.captSqr = 1; f.toPiece = board[1];
+       f.epSqr = -1; f.fromSqr = f.toSqr = f.captSqr = 1; f.toPiece = stm; // fake Pawn to suppress early move gen in reply node
        deprec[ply] = maxDepth << 16 | depth << 8; path[ply++] = 0;
        score = -Search(stm, -beta, 1-beta, &f, nullDepth, 0, nullDepth);
        ply--;