1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Fix a bug in generate_evasions()

Introduced in the patch "movegen: prefer (*mlist++) to mlist[n++]"

This was nasty because due to a mismerge the repo in one PC had the bug,
but the testing one did not, so I had non reproducible results according
to which machine I used for testing.

This hopefully closes a more then one week regression that made me go crazy!

It was found by accident comparing, for other reasons, the sources of the
two PC's.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2008-10-27 10:15:51 +01:00
parent 74fd57220e
commit 5e2fc2aa16

View file

@ -306,26 +306,26 @@ int generate_evasions(const Position& pos, MoveStack* mlist) {
// Pawn moves. Because a blocking evasion can never be a capture, we
// only generate pawn pushes.
if (us == WHITE)
generate_pawn_blocking_evasions<WHITE>(pos, not_pinned, blockSquares, mlist);
mlist = generate_pawn_blocking_evasions<WHITE>(pos, not_pinned, blockSquares, mlist);
else
generate_pawn_blocking_evasions<BLACK>(pos, not_pinned, blockSquares, mlist);
mlist = generate_pawn_blocking_evasions<BLACK>(pos, not_pinned, blockSquares, mlist);
// Pieces moves
b1 = pos.knights(us) & not_pinned;
if (b1)
generate_piece_blocking_evasions<KNIGHT>(pos, b1, blockSquares, mlist);
mlist = generate_piece_blocking_evasions<KNIGHT>(pos, b1, blockSquares, mlist);
b1 = pos.bishops(us) & not_pinned;
if (b1)
generate_piece_blocking_evasions<BISHOP>(pos, b1, blockSquares, mlist);
mlist = generate_piece_blocking_evasions<BISHOP>(pos, b1, blockSquares, mlist);
b1 = pos.rooks(us) & not_pinned;
if (b1)
generate_piece_blocking_evasions<ROOK>(pos, b1, blockSquares, mlist);
mlist = generate_piece_blocking_evasions<ROOK>(pos, b1, blockSquares, mlist);
b1 = pos.queens(us) & not_pinned;
if (b1)
generate_piece_blocking_evasions<QUEEN>(pos, b1, blockSquares, mlist);
mlist = generate_piece_blocking_evasions<QUEEN>(pos, b1, blockSquares, mlist);
}
// Finally, the ugly special case of en passant captures. An en passant