Fix score-range return on pin break
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 17 Feb 2018 18:26:54 +0000 (19:26 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 17 Feb 2018 18:26:54 +0000 (19:26 +0100)
The lower end of the score range was not returned when a node was aborted
because the pin test detected King capture.

dropper.c

index 959a50a..b46c031 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1124,8 +1124,10 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction,
     if(ply > 90) { if(DEBUG) Dump("maxply"); ff->depth = 0; ff->lim = ff->newEval-150; return -ff->newEval+150; }
     f.xking = location[stm+31]; // opponent King, as stm not yet toggled
     if(!earlyGen && ff->mutation > 0) { // if other piece was moved (not dropped!), abort with +INF score if it was pinned
-       if(Pinned(stm, ff->fromSqr, f.xking)) return INF;
-       if(board[ff->captSqr] == 0 && Pinned(stm, ff->captSqr, f.xking)) return INF; // also check 'e.p. pin'
+       if(Pinned(stm, ff->fromSqr, f.xking) ||
+          board[ff->captSqr] == 0 && Pinned(stm, ff->captSqr, f.xking)) { // also check 'e.p. pin'
+           ff->depth = MAXPLY; ff->lim = -INF; return INF;
+       }
     }