Consistent capture_or_promotion for special moves
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 26 Oct 2019 19:24:02 +0000 (21:24 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 26 Oct 2019 19:24:02 +0000 (21:24 +0200)
No functional change except for cambodian, micro, and kyotoshogi.

src/position.h

index 3de568e..19970bd 100644 (file)
@@ -844,7 +844,7 @@ inline bool Position::is_chess960() const {
 
 inline bool Position::capture_or_promotion(Move m) const {
   assert(is_ok(m));
-  return type_of(m) != NORMAL && type_of(m) != PIECE_PROMOTION ? type_of(m) != DROP && type_of(m) != CASTLING : !empty(to_sq(m));
+  return type_of(m) == PROMOTION || type_of(m) == ENPASSANT || (type_of(m) != CASTLING && !empty(to_sq(m)));
 }
 
 inline bool Position::capture(Move m) const {