Skip to content

Conversation

@johndoknjas
Copy link
Contributor

We must check if the dest square has a piece before making the move.

@ornicar
Copy link
Collaborator

ornicar commented Dec 22, 2025

what does this fix?

Isn't pieceFormerlyAtDest null in case of en-passant?

@johndoknjas johndoknjas marked this pull request as draft December 22, 2025 18:39
@johndoknjas
Copy link
Contributor Author

@ornicar Good point about en passant, I'll fix that.

Currently took is true even on non-capture moves, since our own piece has already moved to the dest (so checking if there's a piece on the dest is meaningless). E.g. for this, every move makes the take sound.

@johndoknjas johndoknjas marked this pull request as ready for review December 23, 2025 03:04
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