From 65feff465ea58a999038c877dbf1c4b1e9ae86ab Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Tue, 5 May 2020 19:47:48 +0200 Subject: [PATCH] Fix Janggi cannon pin detection (#106) --- src/position.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 73698b2..c74f933 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -744,8 +744,8 @@ Bitboard Position::slider_blockers(Bitboard sliders, Square s, Bitboard& pinners if (b && (!more_than_one(b) || ((AttackRiderTypes[type_of(piece_on(sniperSq))] & HOPPING_RIDERS) && popcount(b) == 2))) { // Janggi cannons block each other - if ((pieces(JANGGI_CANNON) & sniperSq) && (pieces(JANGGI_CANNON) & blockers)) - blockers &= pieces(JANGGI_CANNON); + if ((pieces(JANGGI_CANNON) & sniperSq) && (pieces(JANGGI_CANNON) & b)) + b &= pieces(JANGGI_CANNON); blockers |= b; if (b & pieces(color_of(piece_on(s)))) pinners |= sniperSq; -- 1.7.0.4