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

Fix for bug in cachedInCheckValue when doing/undoing turnskips #350

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RobotLazerShark
Copy link

@RobotLazerShark RobotLazerShark commented Jul 26, 2023

This PR fixes a bug in the ForceSkipTurn(), TrySkipTurn(), and UndoSkipTurn() methods. Currently if you use any of these three methods to change the turn and then on that same turn use IsInCheck(), you will always get back false.

I did two full runs of the tests, one where after every board setup or move I added a ForceSkipTurn() followed by an UndoSkipTurn(), and one where I updated the position setup fens to flip the turn order and then added a ForceSkipTurn() immediately after. In both cases all the tests still passed.

I did see a comment on the MakeNullMove() method in the Chess.Board class about being in check potentially being an issue, but I didn't see any (other) code that seemed like that would be an issue (and also didn't notice any issues with this in the tests).

VitorA29 added a commit to VitorA29/Chess-Challenge that referenced this pull request Aug 17, 2023
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

Successfully merging this pull request may close these issues.

1 participant