aboutsummaryrefslogtreecommitdiff
path: root/src/grossmeister/move_selector.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-09-04 14:25:05 +0300
committereug-vs <eugene@eug-vs.xyz>2023-09-04 14:25:05 +0300
commit9d8304d35d5f9e8f9e70f231971b064e9e22ad68 (patch)
tree93b0c9d2d05b295eec3f3ee6bc5289c8894496d7 /src/grossmeister/move_selector.rs
parentb1bec57cafc89b97b99795da8484ee34da773105 (diff)
downloadchessnost-9d8304d35d5f9e8f9e70f231971b064e9e22ad68.tar.gz
fix: dont put scores outside of bounds in table
Diffstat (limited to 'src/grossmeister/move_selector.rs')
-rw-r--r--src/grossmeister/move_selector.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/grossmeister/move_selector.rs b/src/grossmeister/move_selector.rs
index 33f836b..c55051e 100644
--- a/src/grossmeister/move_selector.rs
+++ b/src/grossmeister/move_selector.rs
@@ -2,7 +2,7 @@ use smallvec::SmallVec;
use crate::{moves::Move, board::{Board, move_generation::MoveList}};
-use super::Grossmeister;
+use super::{Grossmeister, ttable::NodeType};
pub type ScoredMove = (Move, f32);
pub type ScoredMoveList = SmallVec<[ScoredMove; 128]>;
@@ -165,7 +165,11 @@ impl Grossmeister {
MoveGenStage::Hash => {
self.next_stage();
if let Some(transposition) = self.transposition() {
- return Some(transposition.mov);
+ if transposition.node_type != NodeType::All {
+ if let Some(mov) = transposition.mov {
+ return Some(mov)
+ }
+ }
}
}
MoveGenStage::WinningOrEqualTactical => {