fix regression caused by #2255#2272
Merged
veloce merged 1 commit intolichess-org:mainfrom Oct 17, 2025
Merged
Conversation
I wrongly assumed that addMoveAt() already converts castling notation for us, but that function is only called when new nodes are added to the move tree in an active game, but not when parsing a study chapter. This is why lichess-org#2255 fixed the bug of a mve being incorrectly interpreted as alt-castling, but it now broke the annotations if the move actually WAS a castling move. Luckily, while in addMoveAt() there are some heuristics because we only have the UCI move, not the SAN move, in the AnalysisBoard we *do* have the SAN move, so we can just check for O-O/O-O-O to avoid false positives. Resolves lichess-org#2231
veloce
approved these changes
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wrongly assumed that addMoveAt() already converts castling notation for us, but that function is only called when new nodes are added to the move tree in an active game, but not when parsing a study chapter.
This is why #2255 fixed the bug of a move being incorrectly interpreted as alt-castling, but it now broke the annotations if the move actually WAS a castling move.
Luckily, while in addMoveAt() there are some heuristics because we only have the UCI move, not the SAN move, in the AnalysisBoard we do have the SAN move, so we can just check for O-O/O-O-O to avoid false positives.
Resolves #2231