Skip to content

Commit 981613d

Browse files
anematodePikaCat-OuO
authored andcommitted
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. No functional change
1 parent 6e76aff commit 981613d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/movepick.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ ExtMove* MovePicker::score(MoveList<Type>& ml) {
134134
pos.attacks_by<ADVISOR>(~us) | pos.attacks_by<BISHOP>(~us) | threatByLesser[ADVISOR];
135135
threatByLesser[ROOK] =
136136
pos.attacks_by<KNIGHT>(~us) | pos.attacks_by<CANNON>(~us) | threatByLesser[KNIGHT];
137-
threatByLesser[KING] = pos.attacks_by<ROOK>(~us) | threatByLesser[ROOK];
137+
threatByLesser[KING] = 0;
138138
}
139139

140140
ExtMove* it = cur;

0 commit comments

Comments
 (0)