]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Fix compilation after recent merge.
[stockfish] / src / movegen.cpp
index cf457d1176cc49b071e24f57575c7f85a91c1842..7d6856bb03682f393dc2f34141e23ac2b2248c4a 100644 (file)
@@ -31,18 +31,12 @@ namespace {
 template<GenType Type, Direction D, bool Enemy>
 ExtMove* make_promotions(ExtMove* moveList, [[maybe_unused]] Square to) {
 
-    if constexpr (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
-    {
+    constexpr bool all = Type == EVASIONS || Type == NON_EVASIONS;
+
+    if constexpr (Type == CAPTURES || all)
         *moveList++ = make<PROMOTION>(to - D, to, QUEEN);
-        if constexpr (Enemy && Type == CAPTURES)
-        {
-            *moveList++ = make<PROMOTION>(to - D, to, ROOK);
-            *moveList++ = make<PROMOTION>(to - D, to, BISHOP);
-            *moveList++ = make<PROMOTION>(to - D, to, KNIGHT);
-        }
-    }
 
-    if constexpr ((Type == QUIETS && !Enemy) || Type == EVASIONS || Type == NON_EVASIONS)
+    if constexpr ((Type == CAPTURES && Enemy) || (Type == QUIETS && !Enemy) || all)
     {
         *moveList++ = make<PROMOTION>(to - D, to, ROOK);
         *moveList++ = make<PROMOTION>(to - D, to, BISHOP);
@@ -241,7 +235,6 @@ ExtMove* generate_all(const Position& pos, ExtMove* moveList) {
 //                except castling and promotions
 //
 // Returns a pointer to the end of the move list.
-
 template<GenType Type>
 ExtMove* generate(const Position& pos, ExtMove* moveList) {