mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 18:19:35 +00:00
Fix assignment of pv[0] when creating root move list
It is bogusly assigned from moves[i].move instead of mlist[i].move or equivalently to moves[count].move that it seem more clear to me. Bug is hidden while all the moves are included, in this default case moves[i].move and mlist[i].move are the same variable. Also a bit of cleanup while there. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
f1d982e2c0
commit
00a3380885
1 changed files with 14 additions and 16 deletions
|
@ -1921,7 +1921,7 @@ namespace {
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|
||||||
RootMove::RootMove() {
|
RootMove::RootMove() {
|
||||||
nodes = cumulativeNodes = 0ULL;
|
nodes = cumulativeNodes = ourBeta = theirBeta = 0ULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RootMove::operator<() is the comparison function used when
|
// RootMove::operator<() is the comparison function used when
|
||||||
|
@ -1957,22 +1957,20 @@ namespace {
|
||||||
for (int k = 0; !includeMove && searchMoves[k] != MOVE_NONE; k++)
|
for (int k = 0; !includeMove && searchMoves[k] != MOVE_NONE; k++)
|
||||||
includeMove = (searchMoves[k] == mlist[i].move);
|
includeMove = (searchMoves[k] == mlist[i].move);
|
||||||
|
|
||||||
if (includeMove)
|
if (!includeMove)
|
||||||
{
|
continue;
|
||||||
// Find a quick score for the move
|
|
||||||
StateInfo st;
|
|
||||||
SearchStack ss[PLY_MAX_PLUS_2];
|
|
||||||
|
|
||||||
moves[count].move = mlist[i].move;
|
// Find a quick score for the move
|
||||||
moves[count].nodes = 0ULL;
|
StateInfo st;
|
||||||
pos.do_move(moves[count].move, st);
|
SearchStack ss[PLY_MAX_PLUS_2];
|
||||||
moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE,
|
|
||||||
Depth(0), 1, 0);
|
moves[count].move = mlist[i].move;
|
||||||
pos.undo_move(moves[count].move);
|
pos.do_move(moves[count].move, st);
|
||||||
moves[count].pv[0] = moves[i].move;
|
moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0);
|
||||||
moves[count].pv[1] = MOVE_NONE; // FIXME
|
pos.undo_move(moves[count].move);
|
||||||
count++;
|
moves[count].pv[0] = moves[count].move;
|
||||||
}
|
moves[count].pv[1] = MOVE_NONE; // FIXME
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
sort();
|
sort();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue