From 847a1cc4a8286a72b3713b67001672e7df417f1c Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 8 Feb 2019 19:07:49 +0100 Subject: [PATCH] Skip king protector bonus when there is no king --- src/evaluate.cpp | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f61f9af..e5863ad 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -387,6 +387,7 @@ namespace { score += MinorBehindPawn; // Penalty if the piece is far from the king + if (pos.count(Us)) score -= KingProtector[Pt == BISHOP] * distance(s, pos.square(Us)); if (Pt == BISHOP) -- 1.7.0.4