doing copy make in NMP #9

Merged
rektdie merged 3 commits from NMP into legalMovegen 2025-03-06 07:09:20 +01:00
Showing only changes of commit 1f868f07d2 - Show all commits
+7 -8
View File
@@ -155,31 +155,30 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) {
if (depth <= 0) return Quiescence(board, alpha, beta);
int score = -inf;
int nodeType = AllNode;
if (board.InCheck(board.sideToMove)) {
depth++;
} else {
//Null Move Pruning
if (!doingNullMove) {
if (ply && depth >= 3 && !board.InPossibleZug(board.sideToMove)) {
board.MakeMove(Move());
Board copy = board;
copy.MakeMove(Move());
doingNullMove = true;
ply++;
score = -PVS(board, depth - 3, -beta, -beta + 1).score;
int score = -PVS(copy, depth - 3, -beta, -beta + 1).score;
ply--;
doingNullMove = false;
board.MakeMove(Move());
if (searchStopped) return 0;
if (score >= beta) return beta;
if (score >= beta) return score;
}
}
}
int score = -inf;
int nodeType = AllNode;
nodes++;
GenerateMoves(board, board.sideToMove);