Skip to content

Commit

Permalink
check for turn in position searches
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Feb 11, 2024
1 parent a287d79 commit 929dc1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src-tauri/src/db/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ impl<'de> Deserialize<'de> for PositionQuery {
impl PositionQuery {
fn matches(&self, position: &Chess) -> bool {
match self {
PositionQuery::Exact(ref data) => data.position.board() == position.board(),
PositionQuery::Exact(ref data) => {
data.position.board() == position.board() && data.position.turn() == position.turn()
}
PositionQuery::Partial(ref data) => {
let query_board = &data.piece_positions.board;
let tested_board = position.board();
Expand Down

0 comments on commit 929dc1b

Please sign in to comment.