1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-06 11:29: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:
Marco Costalba 2009-04-29 15:53:37 +02:00
parent f1d982e2c0
commit 00a3380885

View file

@ -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,23 +1957,21 @@ 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 // Find a quick score for the move
StateInfo st; StateInfo st;
SearchStack ss[PLY_MAX_PLUS_2]; SearchStack ss[PLY_MAX_PLUS_2];
moves[count].move = mlist[i].move; moves[count].move = mlist[i].move;
moves[count].nodes = 0ULL;
pos.do_move(moves[count].move, st); pos.do_move(moves[count].move, st);
moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0);
Depth(0), 1, 0);
pos.undo_move(moves[count].move); pos.undo_move(moves[count].move);
moves[count].pv[0] = moves[i].move; moves[count].pv[0] = moves[count].move;
moves[count].pv[1] = MOVE_NONE; // FIXME moves[count].pv[1] = MOVE_NONE; // FIXME
count++; count++;
} }
}
sort(); sort();
} }