X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=97218baa19f9627cb27ce59948c255e18cef0b81;hp=34ec48902cfe9986d5c786e11b92fcdc5efc8566;hb=30a905c95d0b77874244c8b68ae77daba41ac545;hpb=8bb7a737087ca82cb97380bf06bbfa659dec1f73 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 34ec4890..97218baa 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -421,7 +421,7 @@ namespace { // which are attacked twice in that flank but not defended by our pawns. kingFlank = KingFlank[file_of(ksq)]; b1 = attackedBy[Them][ALL_PIECES] & kingFlank & Camp; - b2 = b1 & attackedBy2[Them] & ~attackedBy[Us][PAWN]; + b2 = b1 & attackedBy2[Them]; int tropism = popcount(b1) + popcount(b2); @@ -480,15 +480,12 @@ namespace { + 4 * tropism - 873 * !pos.count(Them) - 6 * mg_value(score) / 8 + + mg_value(mobility[Them] - mobility[Us]) - 30; // Transform the kingDanger units into a Score, and subtract 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); - } } // Penalty when our king is on a pawnless flank