summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0fb5d7a)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
#include <cassert>
#include <cstring>
#include <cassert>
#include <cstring>
#include "movegen.h"
#include "tt.h"
#include "movegen.h"
#include "tt.h"
void TranspositionTable::insert_pv(const Position& pos, Move pv[]) {
StateInfo st;
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])
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);
}
}
p.do_move(pv[i], st);
}
}