From 4c0878cb0b710f2409af0fea036ea1bb3d6f26ed Mon Sep 17 00:00:00 2001 From: anematode Date: Fri, 27 Feb 2026 16:29:44 -0800 Subject: [PATCH] skip setting threatByLesser[KING] It doesn't make sense for a king to move to a square threatened by a lesser piece, since that move would be illegal. closes https://github.com/official-stockfish/Stockfish/pull/6640 No functional change --- src/movepick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index e4a610afe..23b7facbb 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -136,7 +136,7 @@ ExtMove* MovePicker::score(MoveList& ml) { threatByLesser[ROOK] = pos.attacks_by(~us) | pos.attacks_by(~us) | threatByLesser[KNIGHT]; threatByLesser[QUEEN] = pos.attacks_by(~us) | threatByLesser[ROOK]; - threatByLesser[KING] = pos.attacks_by(~us) | threatByLesser[QUEEN]; + threatByLesser[KING] = 0; } ExtMove* it = cur;