I'm using ForceSkipTurn() a bunch in my bot code, and saw in the comments etc. that there were potentially some issues when calling this method if the current player is in check. I took some time to try and find the source of the issue, but I don't fully understand everything that is happening with the different board classes and all the bitboards and stuff.
What I did find is that currently in the Chess.Board class the MakeNullMove() and UnmakeNullMove() methods at the end always set the cached in check value to false (see https://github.com/SebLague/Chess-Challenge/pull/350/files). I feel like this might have been an optimization though, not the root cause (because we initially only had TrySkipTurn, which wouldn't do anything if you were in check).
I was hoping someone else here would be able to tell if there's a different issue that I missed, or if this caching thing is the only problem.
I'm using ForceSkipTurn() a bunch in my bot code, and saw in the comments etc. that there were potentially some issues when calling this method if the current player is in check. I took some time to try and find the source of the issue, but I don't fully understand everything that is happening with the different board classes and all the bitboards and stuff.
What I did find is that currently in the Chess.Board class the MakeNullMove() and UnmakeNullMove() methods at the end always set the cached in check value to false (see https://github.com/SebLague/Chess-Challenge/pull/350/files). I feel like this might have been an optimization though, not the root cause (because we initially only had TrySkipTurn, which wouldn't do anything if you were in check).
I was hoping someone else here would be able to tell if there's a different issue that I missed, or if this caching thing is the only problem.