X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fevaluate.cpp;h=ac0bf8cce9cc81571873889c3e5714b670cd0f47;hb=b61759e907e508d436b7c0b7ff8ab866454f7ca6;hp=fa3b0a720b2face4a2ac66d6085370f3b8e77e43;hpb=66ce8ad5fd0e67904ca96dd9ac58f2e512a1f380;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index fa3b0a72..ac0bf8cc 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -488,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