mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-17 07:36:23 +08:00
Use std library to sort moves
Functional change due to the fact that now pick_best() is stable, but should be no change in strenght. Example code and ideas by Rein Halbersma. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -513,14 +513,14 @@ bool Position::pl_move_is_legal(Move m, Bitboard pinned) const {
|
||||
assert(piece_color(piece_on(from)) == us);
|
||||
assert(piece_on(king_square(us)) == make_piece(us, KING));
|
||||
|
||||
// En passant captures are a tricky special case. Because they are
|
||||
// rather uncommon, we do it simply by testing whether the king is attacked
|
||||
// after the move is made
|
||||
// En passant captures are a tricky special case. Because they are rather
|
||||
// uncommon, we do it simply by testing whether the king is attacked after
|
||||
// the move is made.
|
||||
if (move_is_ep(m))
|
||||
{
|
||||
Color them = opposite_color(us);
|
||||
Square to = move_to(m);
|
||||
Square capsq = make_square(square_file(to), square_rank(from));
|
||||
Square capsq = to + Square(us == WHITE ? -8 : 8);
|
||||
Square ksq = king_square(us);
|
||||
Bitboard b = occupied_squares();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user