X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=ce98af6f8e01b50eb57ad84537dca8a533b756b3;hp=98ecf72de59c4c32d84210f48ff2e4c7cc3dbf00;hb=fed3e752aec8a43f65b07d0efae0900b942b9c16;hpb=b652720903a6c5fbe2c0c0742ff8a658ae6a5d72 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 98ecf72d..ce98af6f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -221,7 +221,7 @@ namespace { ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us); // Init king safety tables only if we are going to use them - if (pos.count(Us) && pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) + if (pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) { ei.kingRing[Them] = b | shift_bb(b); b &= ei.attackedBy[Us][PAWN]; @@ -414,7 +414,8 @@ namespace { attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2) + 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount(undefended)) + 2 * (ei.pinnedPieces[Us] != 0) - - mg_value(score) / 32; + - mg_value(score) / 32 + - !pos.count(Them) * 15; // Analyse the enemy's safe queen contact checks. Firstly, find the // undefended squares around the king that are attacked by the enemy's @@ -532,7 +533,7 @@ namespace { b = weakEnemies & pos.pieces(Them, PAWN) & ei.attackedBy[Us][KING]; if (b) score += more_than_one(b) ? KingOnPawnMany : KingOnPawnOne; - } + } if (Trace) Tracing::terms[Us][Tracing::THREAT] = score;