From ba1a44f21665056bed6f4b767e1a5b1b381e7e22 Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Mon, 19 Jul 2010 00:19:09 +0300 Subject: [PATCH] Store static value and king danger in TT also in TT.insert_pv() method Signed-off-by: Marco Costalba --- src/tt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tt.cpp b/src/tt.cpp index bc266067..d2f983c9 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -25,6 +25,7 @@ #include #include +#include "evaluate.h" #include "movegen.h" #include "tt.h" @@ -164,13 +165,18 @@ void TranspositionTable::new_search() { void TranspositionTable::insert_pv(const Position& pos, Move pv[]) { StateInfo st; + EvalInfo ei; + Value v; Position p(pos, pos.thread()); for (int i = 0; pv[i] != MOVE_NONE; i++) { TTEntry *tte = retrieve(p.get_key()); if (!tte || tte->move() != pv[i]) - store(p.get_key(), VALUE_NONE, VALUE_TYPE_NONE, Depth(-127*OnePly), pv[i], VALUE_NONE, VALUE_NONE); + { + v = (p.is_check() ? VALUE_NONE : evaluate(p, ei)); + store(p.get_key(), VALUE_NONE, VALUE_TYPE_NONE, Depth(-127*OnePly), pv[i], v, ei.kingDanger[pos.side_to_move()]); + } p.do_move(pv[i], st); } } -- 2.39.2