In case of a fail low we don't want to sort a garbage move in front for
the next iteration.
if(f.depth < resultDepth) resultDepth = f.depth;
if(score > bestScore) {
- bestScore = score; bestNr = curMove;
+ bestScore = score;
if(score > alpha) {
int *tail;
- alpha = score;
+ alpha = score; bestNr = curMove;
history[moveStack[curMove] & 0xFFFF] += iterDepth*iterDepth;
if(score >= beta) { // beta cutoff
if(curMove >= m.nonCapts && moveStack[curMove] != killers[ply][1])