X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=b380dbf074874717e93d5adfcfc6f3d80f54f2b3;hp=d040143272c43ea6ee31d8f205306574b9f24cd8;hb=5d1644ba696c0a4d81450f922d216bf6479d4929;hpb=647402ff7910ff26f5d6b967812d85f5f4259fee diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d0401432..b380dbf0 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -424,36 +424,20 @@ namespace { b2 = pos.attacks_from(ksq) & safe; // Enemy queen safe checks - b = (b1 | b2) & ei.attackedBy[Them][QUEEN]; - if (b) - { - attackUnits += QueenCheck * popcount(b); - score -= Checked; - } + if ((b1 | b2) & ei.attackedBy[Them][QUEEN]) + attackUnits += QueenCheck, score -= Checked; // Enemy rooks safe checks - b = b1 & ei.attackedBy[Them][ROOK]; - if (b) - { - attackUnits += RookCheck * popcount(b); - score -= Checked; - } + if (b1 & ei.attackedBy[Them][ROOK]) + attackUnits += RookCheck, score -= Checked; // Enemy bishops safe checks - b = b2 & ei.attackedBy[Them][BISHOP]; - if (b) - { - attackUnits += BishopCheck * popcount(b); - score -= Checked; - } + if (b2 & ei.attackedBy[Them][BISHOP]) + attackUnits += BishopCheck, score -= Checked; // Enemy knights safe checks - b = pos.attacks_from(ksq) & ei.attackedBy[Them][KNIGHT] & safe; - if (b) - { - attackUnits += KnightCheck * popcount(b); - score -= Checked; - } + if (pos.attacks_from(ksq) & ei.attackedBy[Them][KNIGHT] & safe) + attackUnits += KnightCheck, score -= Checked; // Finally, extract the king danger score from the KingDanger[] // array and subtract the score from the evaluation.