mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Fix: In qsearch do not use TT value when in a PV node
We already do like this in search_pv(), so extend also in qsearch(). Bug spotted by Joona Kiiski. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
74160ac602
commit
16abc165d8
1 changed files with 8 additions and 5 deletions
|
@ -1417,10 +1417,14 @@ namespace {
|
||||||
if (pos.is_draw())
|
if (pos.is_draw())
|
||||||
return VALUE_DRAW;
|
return VALUE_DRAW;
|
||||||
|
|
||||||
// Transposition table lookup
|
// Transposition table lookup, only when not in PV
|
||||||
|
bool pvNode = (beta - alpha != 1);
|
||||||
|
if (!pvNode)
|
||||||
|
{
|
||||||
const TTEntry* tte = TT.retrieve(pos);
|
const TTEntry* tte = TT.retrieve(pos);
|
||||||
if (tte && ok_to_use_TT(tte, depth, beta, ply))
|
if (tte && ok_to_use_TT(tte, depth, beta, ply))
|
||||||
return value_from_tt(tte->value(), ply);
|
return value_from_tt(tte->value(), ply);
|
||||||
|
}
|
||||||
|
|
||||||
// Evaluate the position statically
|
// Evaluate the position statically
|
||||||
EvalInfo ei;
|
EvalInfo ei;
|
||||||
|
@ -1443,7 +1447,6 @@ namespace {
|
||||||
// Initialize a MovePicker object for the current position, and prepare
|
// Initialize a MovePicker object for the current position, and prepare
|
||||||
// to search the moves. Because the depth is <= 0 here, only captures,
|
// to search the moves. Because the depth is <= 0 here, only captures,
|
||||||
// queen promotions and checks (only if depth == 0) will be generated.
|
// queen promotions and checks (only if depth == 0) will be generated.
|
||||||
bool pvNode = (beta - alpha != 1);
|
|
||||||
MovePicker mp = MovePicker(pos, pvNode, MOVE_NONE, EmptySearchStack, depth, isCheck ? NULL : &ei);
|
MovePicker mp = MovePicker(pos, pvNode, MOVE_NONE, EmptySearchStack, depth, isCheck ? NULL : &ei);
|
||||||
Move move;
|
Move move;
|
||||||
int moveCount = 0;
|
int moveCount = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue