The 'stat01' commans must report on the move that is currently being
searched. Not the one that just has been searched. So the statement
to save the root info globally has been moved to before the recursive call.
} else { // not a repeat: search it
int lmr;
search:
+ if(ply == 0) rootFirst = m.firstMove, rootLast = moveSP, rootCurrent = curMove, rootPly = iterDepth;
lmr = (curMove >= m.late) + (curMove >= m.drops);
f.tpGain = f.newEval + ff->pstEval; // material gain in last two ply
if(ply==0 && randomize && moveNr < 10) ran = (alpha > INF-100 || alpha <-INF+100 ? 0 : (f.newKey*ranKey>>24 & 31)- 16);
alpha = bestScore - margin;
}
}
- if(ply == 0) rootFirst = m.firstMove, rootLast = moveSP, rootCurrent = curMove, rootPly = iterDepth;
} // move loop
// stalemate correction