X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=b7a596efba1bfc1f9af5e50971bfae7abd4dcda6;hp=8cc481726b0760d445dc191ecb5b6f3e7687ac7b;hb=b15dcd977487c58409de48016eb7680850481d5d;hpb=57fdfdedcf8c910fc9ad6c827a1a4dae372d3606 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 8cc48172..b7a596ef 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -57,9 +57,8 @@ namespace { // kingAttackersWeight[color] is the sum of the "weight" of the pieces of the // given color which attack a square in the kingRing of the enemy king. The - // weights of the individual piece types are given by the variables - // QueenAttackWeight, RookAttackWeight, BishopAttackWeight and - // KnightAttackWeight in evaluate.cpp + // weights of the individual piece types are given by the elements in the + // KingAttackWeights array. int kingAttackersWeight[COLOR_NB]; // kingAdjacentZoneAttacksCount[color] is the number of attacks to squares @@ -504,10 +503,9 @@ namespace { Bitboard b, weak, defended; Score score = SCORE_ZERO; - // Non-pawn enemies defended by a pawn and under our attack + // Non-pawn enemies defended by a pawn defended = (pos.pieces(Them) ^ pos.pieces(Them, PAWN)) - & ei.attackedBy[Them][PAWN] - & (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP] | ei.attackedBy[Us][ROOK]); + & ei.attackedBy[Them][PAWN]; // Add a bonus according to the kind of attacking pieces if (defended)