From: Joona Kiiski Date: Sun, 18 Jul 2010 21:19:09 +0000 (+0300) Subject: Store static value and king danger in TT also in TT.insert_pv() method X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=ba1a44f21665056bed6f4b767e1a5b1b381e7e22 Store static value and king danger in TT also in TT.insert_pv() method Signed-off-by: Marco Costalba --- 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); } }