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

Invalid King is in check expcetion #2

Closed
onspli opened this issue Sep 15, 2021 · 1 comment · Fixed by #3
Closed

Invalid King is in check expcetion #2

onspli opened this issue Sep 15, 2021 · 1 comment · Fixed by #3
Assignees
Labels
bug Something isn't working

Comments

@onspli
Copy link
Owner

onspli commented Sep 15, 2021

$fen = new Chess\FEN("2Q5/8/8/8/p3Q3/P7/7p/1K4k1 b - - 0 53");
$fen->move('h1=Q');

should not throw:

Onspli\Chess\RulesException: King is in check. in /var/www/html/chesstats/vendor/onspli/chess/src/FEN.php on line 737
@onspli onspli added the bug Something isn't working label Sep 15, 2021
@onspli onspli self-assigned this Sep 17, 2021
@onspli
Copy link
Owner Author

onspli commented Sep 17, 2021

Caused by promoting black pawn to white Queen - position after move is 2Q5/8/8/8/p3Q3/P7/8/1K4kQ and king is in check indeed. Promoting must be fixed.

@onspli onspli mentioned this issue Sep 17, 2021
@onspli onspli closed this as completed in #3 Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant