mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Store static value and king danger in TT also in TT.insert_pv() method
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
0fb5d7a737
commit
ba1a44f216
1 changed files with 7 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "evaluate.h"
|
||||||
#include "movegen.h"
|
#include "movegen.h"
|
||||||
#include "tt.h"
|
#include "tt.h"
|
||||||
|
|
||||||
|
@ -164,13 +165,18 @@ void TranspositionTable::new_search() {
|
||||||
void TranspositionTable::insert_pv(const Position& pos, Move pv[]) {
|
void TranspositionTable::insert_pv(const Position& pos, Move pv[]) {
|
||||||
|
|
||||||
StateInfo st;
|
StateInfo st;
|
||||||
|
EvalInfo ei;
|
||||||
|
Value v;
|
||||||
Position p(pos, pos.thread());
|
Position p(pos, pos.thread());
|
||||||
|
|
||||||
for (int i = 0; pv[i] != MOVE_NONE; i++)
|
for (int i = 0; pv[i] != MOVE_NONE; i++)
|
||||||
{
|
{
|
||||||
TTEntry *tte = retrieve(p.get_key());
|
TTEntry *tte = retrieve(p.get_key());
|
||||||
if (!tte || tte->move() != pv[i])
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue