From 81b0addcc9d5ff2b428981ca88ee0acdec4db2a9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 3 Sep 2023 06:26:32 +0300 Subject: fix: also break if we overjumped mating depth --- src/grossmeister/search.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/grossmeister') diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index 1aa73a0..fb7e385 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -292,8 +292,8 @@ impl Grossmeister { } println!(); - // If our is mate in N, we break at depth N - if SCORE_MATE - search_result.0.abs() == depth as f32 { + // If our score is mate in N, we break at depth N + if depth as f32 >= SCORE_MATE - search_result.0.abs() { result = Some(search_result); break; } -- cgit v1.2.3