X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;h=5b8f2e9a8a1103410b740488cf2f88d793c72f25;hp=e0f3baacd5413fe238e5d5bb665137238725c6d4;hb=36bb57a47e137f075fe546887be01fdd0d4670e3;hpb=9c8c0de538317f4270a62c6b525cad1ff8303d16 diff --git a/src/movegen.cpp b/src/movegen.cpp index e0f3baac..5b8f2e9a 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -362,7 +362,6 @@ namespace { inline MoveStack* generate_promotions(const Position& pos, MoveStack* mlist, Bitboard pawnsOn7, Bitboard target) { const Bitboard TFileABB = (Delta == DELTA_NE || Delta == DELTA_SE ? FileABB : FileHBB); - const Color Them = (Delta > 0 ? BLACK : WHITE); Bitboard b; Square to; @@ -390,7 +389,7 @@ namespace { // This is the only possible under promotion that can give a check // not already included in the queen-promotion. if ( Type == MV_CHECK - && bit_is_set(pos.attacks_from(to), pos.king_square(Them))) + && bit_is_set(pos.attacks_from(to), pos.king_square(Delta > 0 ? BLACK : WHITE))) (*mlist++).move = make_promotion_move(to - Delta, to, KNIGHT); else (void)pos; // Silence a warning under MSVC } @@ -406,8 +405,8 @@ namespace { const Bitboard TRank7BB = (Us == WHITE ? Rank7BB : Rank2BB); const Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB); const Square UP = (Us == WHITE ? DELTA_N : DELTA_S); - const Square RIGHT_UP = (Us == WHITE ? DELTA_NE : DELTA_SE); - const Square LEFT_UP = (Us == WHITE ? DELTA_NW : DELTA_SW); + const Square RIGHT_UP = (Us == WHITE ? DELTA_NE : DELTA_SW); + const Square LEFT_UP = (Us == WHITE ? DELTA_NW : DELTA_SE); Square to; Bitboard b1, b2, dc1, dc2, pawnPushes, emptySquares;