Revise palace attacks for rook
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 16 Sep 2020 20:13:01 +0000 (22:13 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 16 Sep 2020 20:13:01 +0000 (22:13 +0200)
janggi
Total: 500 W: 268 L: 221 D: 11

src/evaluate.cpp

index f91626f..6d01a5a 100644 (file)
@@ -303,7 +303,7 @@ namespace {
     {
         // Find attacked squares, including x-ray attacks for bishops and rooks
         b = Pt == BISHOP ? attacks_bb<BISHOP>(s, pos.pieces() ^ pos.pieces(QUEEN))
-          : Pt ==   ROOK ? attacks_bb<  ROOK>(s, pos.pieces() ^ pos.pieces(QUEEN) ^ pos.pieces(Us, ROOK))
+          : Pt ==   ROOK && !pos.diagonal_lines() ? attacks_bb<  ROOK>(s, pos.pieces() ^ pos.pieces(QUEEN) ^ pos.pieces(Us, ROOK))
                          : pos.attacks_from(Us, Pt, s);
 
         // Restrict mobility to actual squares of board