X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=68984802e5193185aae5b3f648173563948bd94d;hp=a19f346d92328049d477e04701053de4bc413d21;hb=4fc773454759081c2cd921e460d542f2dfd4aa24;hpb=cd782c11ec8e765e3a323e422cea19d7d053a07c diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a19f346d..68984802 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -530,7 +530,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // Bishop and knight outposts squares if ( (Piece == BISHOP || Piece == KNIGHT) - && !(pos.pieces(Them, PAWN) & attack_span_mask(Us, s))) + && !(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) score += evaluate_outposts(pos, ei, s); if ( (Piece == ROOK || Piece == QUEEN) @@ -541,8 +541,8 @@ Value do_evaluate(const Position& pos, Value& margin) { && relative_rank(Us, pos.king_square(Them)) == RANK_8) score += Piece == ROOK ? RookOn7th : QueenOn7th; - // Major piece attacking enemy pawns on the same rank - Bitboard pawns = pos.pieces(Them, PAWN) & rank_bb(s); + // Major piece attacking enemy pawns on the same rank/file + Bitboard pawns = pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]; if (pawns) score += popcount(pawns) * (Piece == ROOK ? RookOnPawn : QueenOnPawn); } @@ -821,8 +821,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // 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 ( (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) - && (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from(s))) + if (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from(s)) unsafeSquares = squaresToQueen; else unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them)); @@ -990,7 +989,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // black pawns: a4, b4 white: b2 then pawn in b4 is giving support. if (!opposed) { - b2 = supporters & in_front_bb(winnerSide, blockSq + pawn_push(winnerSide)); + b2 = supporters & in_front_bb(winnerSide, rank_of(blockSq + pawn_push(winnerSide))); while (b2) // This while-loop could be replaced with LSB/MSB (depending on color) { @@ -1000,7 +999,7 @@ Value do_evaluate(const Position& pos, Value& margin) { } // Check pawns that can be sacrificed against the blocking pawn - b2 = attack_span_mask(winnerSide, blockSq) & candidates & ~(1ULL << s); + b2 = pawn_attack_span(winnerSide, blockSq) & candidates & ~(1ULL << s); while (b2) // This while-loop could be replaced with LSB/MSB (depending on color) {