mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
Move legal check out of MovePicker
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+6
-1
@@ -880,6 +880,7 @@ split_point_start: // At split points actual search starts from here
|
||||
// Initialize a MovePicker object for the current position
|
||||
MovePickerExt<SpNode, Root> mp(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));
|
||||
CheckInfo ci(pos);
|
||||
Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
|
||||
ss->bestMove = MOVE_NONE;
|
||||
futilityBase = ss->eval + ss->evalMargin;
|
||||
singularExtensionNode = !Root
|
||||
@@ -908,7 +909,7 @@ split_point_start: // At split points actual search starts from here
|
||||
moveCount = ++sp->moveCount;
|
||||
lock_release(&(sp->lock));
|
||||
}
|
||||
else if (move == excludedMove)
|
||||
else if (move == excludedMove || !pos.pl_move_is_legal(move, pinned))
|
||||
continue;
|
||||
else
|
||||
moveCount++;
|
||||
@@ -1325,6 +1326,7 @@ split_point_start: // At split points actual search starts from here
|
||||
// be generated.
|
||||
MovePicker mp(pos, ttMove, depth, H);
|
||||
CheckInfo ci(pos);
|
||||
Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
|
||||
|
||||
// Loop through the moves until no moves remain or a beta cutoff occurs
|
||||
while ( alpha < beta
|
||||
@@ -1332,6 +1334,9 @@ split_point_start: // At split points actual search starts from here
|
||||
{
|
||||
assert(move_is_ok(move));
|
||||
|
||||
if (!pos.pl_move_is_legal(move, pinned))
|
||||
continue;
|
||||
|
||||
givesCheck = pos.move_gives_check(move, ci);
|
||||
|
||||
// Futility pruning
|
||||
|
||||
Reference in New Issue
Block a user