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
This commit is contained in:
anematode
2026-02-28 12:07:38 +01:00
committed by Joost VandeVondele
parent bc28ff15bd
commit 4c0878cb0b
+1 -1
View File
@@ -136,7 +136,7 @@ ExtMove* MovePicker::score(MoveList<Type>& ml) {
threatByLesser[ROOK] =
pos.attacks_by<KNIGHT>(~us) | pos.attacks_by<BISHOP>(~us) | threatByLesser[KNIGHT];
threatByLesser[QUEEN] = pos.attacks_by<ROOK>(~us) | threatByLesser[ROOK];
threatByLesser[KING] = pos.attacks_by<QUEEN>(~us) | threatByLesser[QUEEN];
threatByLesser[KING] = 0;
}
ExtMove* it = cur;