moveCount = ++sp->moveCount;
lock_release(&(sp->lock));
}
- else if (move == excludedMove || !pos.pl_move_is_legal(move, pinned))
+ else if (move == excludedMove)
continue;
else
moveCount++;
// a margin then we extend ttMove.
if ( singularExtensionNode
&& move == ttMove
+ && pos.pl_move_is_legal(move, pinned)
&& ext < ONE_PLY)
{
Value ttValue = value_from_tt(tte->value(), ss->ply);
}
// Update current move (this must be done after singular extension search)
- ss->currentMove = move;
newDepth = depth - ONE_PLY + ext;
// Step 12. Futility pruning (is omitted in PV nodes)
}
}
+ // Check for legality only before to do the move
+ if (!pos.pl_move_is_legal(move, pinned))
+ continue;
+
+ ss->currentMove = move;
+
// Step 13. Make the move
pos.do_move(move, st, ci, givesCheck);
{
assert(move_is_ok(move));
- if (!pos.pl_move_is_legal(move, pinned))
- continue;
-
givesCheck = pos.move_gives_check(move, ci);
// Futility pruning
continue;
}
+ // Check for legality only before to do the move
+ if (!pos.pl_move_is_legal(move, pinned))
+ continue;
+
// Update current move
ss->currentMove = move;