From 85d1f9c5ecb1efab22cea3db8c14fbb2130323e8 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 17 May 2011 23:31:40 +0100 Subject: [PATCH 1/1] Fix move_is_capture() definition The structure of move is changed so should also the two functions. It happens that it works by accident ! Bug spotted by Marek Kwiatkowski No functional change. Signed-off-by: Marco Costalba --- src/position.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/position.h b/src/position.h index 7dcbb6f4..5db64ec3 100644 --- a/src/position.h +++ b/src/position.h @@ -527,13 +527,13 @@ inline bool Position::is_chess960() const { inline bool Position::move_is_capture(Move m) const { assert (m != MOVE_NONE && m != MOVE_NULL); - return (m & (3 << 15)) ? !move_is_castle(m) : !square_is_empty(move_to(m)); + return !square_is_empty(move_to(m)) || move_is_ep(m); } inline bool Position::move_is_capture_or_promotion(Move m) const { assert (m != MOVE_NONE && m != MOVE_NULL); - return (m & (0x1F << 12)) ? !move_is_castle(m) : !square_is_empty(move_to(m)); + return move_is_capture(m) || move_is_promotion(m); } inline PieceType Position::captured_piece_type() const { -- 2.39.2