X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=680b8e0fb58d163598b45a184eb3814f9edc4d0a;hp=58feae39c470b57406c1305c4c43d3ddc9e593b1;hb=b3108547deafc054e73965c954ed70aa909f6f06;hpb=d5f2e32b5c2bba5056df7804704f14af0977a8ed diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 58feae39..680b8e0f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -562,14 +562,14 @@ namespace { } // Special extra evaluation for bishops - if (Piece == BISHOP) + if (Piece == BISHOP && pos.is_chess960()) { // An important Chess960 pattern: A cornered bishop blocked by // a friendly pawn diagonally in front of it is a very serious // problem, especially when that pawn is also blocked. if (s == relative_square(Us, SQ_A1) || s == relative_square(Us, SQ_H1)) { - SquareDelta d = pawn_push(Us) + SquareDelta d = pawn_push(Us) + (square_file(s) == FILE_A ? DELTA_E : DELTA_W); if (pos.piece_on(s + d) == piece_of_color_and_type(Us, PAWN)) { @@ -840,8 +840,8 @@ namespace { // If there is an enemy rook or queen attacking the pawn from behind, // add all X-ray attacks by the rook or queen. Otherwise consider only // the squares in the pawn's path attacked or occupied by the enemy. - if ( (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them)) - && (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from(s))) + if ( (squares_in_front_of(Them, s) & pos.pieces(ROOK, QUEEN, Them)) + && (squares_in_front_of(Them, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from(s))) unsafeSquares = squaresToQueen; else unsafeSquares = squaresToQueen & (ei.attackedBy[Them][0] | pos.pieces_of_color(Them));