Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game.kingIsChecked wrong after own king was in check before delivering check #18

Open
SuperGeroy opened this issue Oct 25, 2017 · 1 comment

Comments

@SuperGeroy
Copy link

When your own king is in check and your move removes the check and at the same time delivers check to the opponent king then the game.kingIsChecked variable is wrong, it is false but should be true.

I stumbled upon the error with the following position FEN:
2K1r3/3P1k2/8/8/8/8/8/2R5 w - - 0 1
where White is in check already.
After the promotion move dxe8Q+ the black king is in check but kingIsChecked is false.
After the promotion move d8N+ the black king is also in check but kingIsChecked is false.

The error has nothing to do with the promotion, I tried it with different positions and the common condition for the error is that the own king is in check directly before you put the enemy king in check.

werner77 pushed a commit to werner77/Sage that referenced this issue Nov 23, 2017
@SuperGeroy
Copy link
Author

The fix by @werner77 (#19) works for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant