No globals #50

Merged
rektdie merged 23 commits from no_globals into main 2025-04-12 13:52:41 +02:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 818b549cba - Show all commits

No files matched your search

+3 -5
View File
@@ -10,8 +10,6 @@
namespace SEARCH {
U64 nodesToGo = 0;
static inline int timeToSearch = 0;
Stopwatch sw;
@@ -147,7 +145,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply, Searc
}
}
} else {
if (ctx.nodes > nodesToGo) {
if (ctx.nodes > ctx.nodesToGo) {
StopSearch();
return 0;
}
@@ -217,7 +215,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply, SearchCo
}
}
} else if constexpr (mode == nodesMode) {
if (ctx.nodes > nodesToGo) {
if (ctx.nodes > ctx.nodesToGo) {
StopSearch();
return 0;
}
@@ -468,7 +466,7 @@ SearchResults SearchPosition(Board &board, SearchParams params, SearchContext& c
ctx.nodes = 0;
if constexpr (mode == nodesMode) {
nodesToGo = params.nodes;
ctx.nodesToGo = params.nodes;
}
}
ctx.pvLine.Clear();
+2
View File
@@ -109,6 +109,8 @@ public:
class SearchContext {
public:
U64 nodes = 0;
U64 nodesToGo = 0;
bool doingNullMove = false;
PVLine pvLine;