Restore analogy stack pointer on second stand pat
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 29 May 2017 14:58:11 +0000 (16:58 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 29 May 2017 15:01:55 +0000 (17:01 +0200)
dropper.c

index 50079b2..9a7bd00 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1202,7 +1202,7 @@ if(PATH)printf("      Hit, d=%d, checker = %x\n",entry->depth,f.checker);
     if(depth <= 0) { // QS
        if(ff->checker != CK_NONE && ff->tpGain > 0) anaEval = 50-INF; // forbid stand pat if horizon check tossed material
        if(anaEval > alpha) {
-           if(anaEval >= beta) { ff->depth = 1; moveSP = oldSP; return anaEval + (anaEval < curEval); } // stand-pat cutoff
+           if(anaEval >= beta) { ff->depth = 1; moveSP = oldSP; anaSP = oldna; return anaEval + (anaEval < curEval); } // stand-pat cutoff
            alpha = startScore = anaEval; maxDepth = 0; // we will not fail low, so no extra iterations
        }
        if(maxDepth <= 0) {
@@ -1230,7 +1230,7 @@ if(PATH)printf("      Hit, d=%d, checker = %x\n",entry->depth,f.checker);
     // move generation
     if(!earlyGen) { // generate moves if we had not done so yet
        if(MoveGen(stm, &m, f.rights)) { // impossible (except for hash collision giving wrong in-check status)
-           if(DEBUG) Dump("King capture"); ff->depth = MAXPLY; moveSP = oldSP; return INF;
+           if(DEBUG) Dump("King capture"); ff->depth = MAXPLY; moveSP = oldSP; anaSP = oldAna; return INF;
        }
        if(f.checkDist && maxDepth <= 1) ipMask = SafeIP(&f);
     }