X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=ac0bf8cce9cc81571873889c3e5714b670cd0f47;hp=c5375a8ec428a4706d972f696a69b2dac11c4165;hb=b508f9561cc2302c129efe8d60f201ff03ee72c8;hpb=9afa1d73306cb98e95acec5daf4efd65e592ceff diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c5375a8e..ac0bf8cc 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -220,7 +220,6 @@ namespace { const Score WeakQueen = S( 50, 10); const Score CloseEnemies = S( 7, 0); const Score PawnlessFlank = S( 20, 80); - const Score ThreatByHangingPawn = S( 71, 61); const Score ThreatBySafePawn = S(192,175); const Score ThreatByRank = S( 16, 3); const Score Hanging = S( 48, 27); @@ -489,7 +488,11 @@ namespace { // Transform the kingDanger units into a Score, and substract it from the evaluation if (kingDanger > 0) + { + int mobilityDanger = mg_value(mobility[Them] - mobility[Us]); + kingDanger = std::max(0, kingDanger + mobilityDanger); score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16); + } } // King tropism: firstly, find squares that opponent attacks in our king flank @@ -543,9 +546,6 @@ namespace { safeThreats = (shift(b) | shift(b)) & weak; score += ThreatBySafePawn * popcount(safeThreats); - - if (weak ^ safeThreats) - score += ThreatByHangingPawn; } // Squares strongly protected by the opponent, either because they attack the