From 9d8304d35d5f9e8f9e70f231971b064e9e22ad68 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 4 Sep 2023 14:25:05 +0300 Subject: fix: dont put scores outside of bounds in table --- src/grossmeister/move_selector.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/grossmeister/move_selector.rs') 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 => { -- cgit v1.2.3