Skip to content

add validDropSquares to GameData to fix invalid drop moves in crazyhouse#90

Merged
veloce merged 1 commit intolichess-org:mainfrom
tom-anders:crazyhouse
Mar 11, 2026
Merged

add validDropSquares to GameData to fix invalid drop moves in crazyhouse#90
veloce merged 1 commit intolichess-org:mainfrom
tom-anders:crazyhouse

Conversation

@tom-anders
Copy link
Contributor

Currently, the board considers any drop onto an open sqaure valid (excluding pawn drops onto the back rank).

However, when in check this breaks down, leading to onMove being called for invalid drops, which is consistent with the behavior for normal moves (and causes crashes in lichess mobile currently).

To fix this, introduce GameData.validDropSquares.

Currently, the board considers any drop onto an open sqaure valid
(excluding pawn drops onto the back rank).

However, when in check this breaks down, leading to `onMove` being
called for invalid drops, which is consistent with the behavior for
normal moves (and causes crashes in lichess mobile currently).

To fix this, introduce `GameData.validDropSquares`.
tom-anders added a commit to tom-anders/lichess-mobile that referenced this pull request Mar 10, 2026
@veloce veloce merged commit 771497e into lichess-org:main Mar 11, 2026
1 check passed
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.

2 participants