chess_console icon indicating copy to clipboard operation
chess_console copied to clipboard

Game::isUnderAttack does not test if the square is under attack from the king

Open mlockett42 opened this issue 6 years ago • 1 comments

In some situations this will incorrectly not award a checkmate

mlockett42 avatar Oct 16 '19 01:10 mlockett42

position

jeromevonk avatar Oct 11 '22 01:10 jeromevonk

You were absolutely right.

Function Game::isUnderAttack now_ checks if a square is under attack by the king, in every direction a king can attack.

There a test condition for this here.

I took me almost 5 years to look at this issue, but... better late than never :P

jeromevonk avatar Jun 06 '24 02:06 jeromevonk