Skip to content

Commit 41e7e0f

Browse files
authored
Merge pull request #1007 from IIvec/master
Less king danger if we have a knight near by to defend it. (official-stockfish#1987)
2 parents 94a480d + 6514500 commit 41e7e0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/evaluate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,13 @@ namespace {
481481
kingDanger += kingAttackersCount[Them] * kingAttackersWeight[Them]
482482
+ 69 * kingAttacksCount[Them]
483483
+ 185 * popcount(kingRing[Us] & weak)
484+
- 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING])
484485
+ 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
485486
+ 5 * tropism * tropism / 16
486487
- 873 * !pos.count<QUEEN>(Them)
487488
- 6 * mg_value(score) / 8
488489
+ mg_value(mobility[Them] - mobility[Us])
489-
- 30;
490+
- 25;
490491

491492
// Transform the kingDanger units into a Score, and subtract it from the evaluation
492493
if (kingDanger > 0)

0 commit comments

Comments
 (0)