1
0
Fork 0
This commit is contained in:
Paul-Nicolas Madelaine 2025-10-19 14:14:10 +02:00
parent faccfbc1c5
commit 192aef1ce7

View file

@ -976,11 +976,6 @@ impl Position {
| d.knight(king_square) & theirs.knight() | d.knight(king_square) & theirs.knight()
| x & theirs.bishop() | x & theirs.bishop()
| y & theirs.rook(); | y & theirs.rook();
let blockers_x_ray = blockers & !(x | y);
let pinned = (d.bishop(king_square, blockers_x_ray) & theirs.bishop()
| d.rook(king_square, blockers_x_ray) & theirs.rook())
.map(|sq| d.segment(king_square, sq))
.reduce_or();
if visitor.roles(Role::King) && global_mask_from.contains(king_square) { if visitor.roles(Role::King) && global_mask_from.contains(king_square) {
let attacked = { let attacked = {
@ -1058,6 +1053,12 @@ impl Position {
return; return;
} }
let blockers_x_ray = blockers & !(x | y);
let pinned = (d.bishop(king_square, blockers_x_ray) & theirs.bishop()
| d.rook(king_square, blockers_x_ray) & theirs.rook())
.map(|sq| d.segment(king_square, sq))
.reduce_or();
let checker = checkers.first(); let checker = checkers.first();
let block_check = checker let block_check = checker
.map(|checker| d.segment(king_square, checker)) .map(|checker| d.segment(king_square, checker))