Prevent check evasions can become killers
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 19:28:38 +0000 (20:28 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 20:03:20 +0000 (21:03 +0100)
Check evasions are tactical replies specific to the preceding moves
(as checks cannot be pre-existing), and are thus not suitable for trying
in sibbling nodes that do not check. It is even unlikely they would carry
over to other checks.

dropper.c

index 155be56..49379dc 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1325,7 +1325,7 @@ printf("%d:%d:%d %2d. %08x %c%d%c%d %6d %6d %6d\n",ply,depth,iterDepth,curMove,m
                    if(score > INF-100 && curMove >= m.nonCapts)
                        mateKillers[(ff->wholeMove & 0xFFFF) + (stm - WHITE << 11)] = moveStack[curMove] & 0xFFFF | f.xking << 16 | board[f.toSqr] << 24; // store mate killers
                    if(score >= beta) { // beta cutoff
-                       if(curMove >= m.nonCapts && moveStack[curMove] != killers[ply][1])
+                       if(f.checker == CK_NONE && curMove >= m.nonCapts && moveStack[curMove] != killers[ply][1])
                            killers[ply][0] = killers[ply][1], killers[ply][1] = moveStack[curMove];
                        resultDepth = f.depth;
                        goto cutoff; // done with this node