Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Fix displaying mate
Browse files Browse the repository at this point in the history
  • Loading branch information
mhib committed Oct 31, 2020
1 parent e467581 commit 0cc4dac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ func (t *thread) quiescence(depth, alpha, beta, height int, inCheck bool) int {
bestMove = move
if val > alpha {
alpha = val
if pvNode {
t.stack[height].PV.assign(move, &t.stack[height+1].PV)
}
if val >= beta {
break
}
t.stack[height].PV.assign(move, &t.stack[height+1].PV)
}

}
Expand Down Expand Up @@ -465,10 +467,12 @@ afterPreMovesPruning:
bestMove = move
if val > alpha {
alpha = val
if pvNode {
t.stack[height].PV.assign(move, &t.stack[height+1].PV)
}
if alpha >= beta {
break
}
t.stack[height].PV.assign(move, &t.stack[height+1].PV)
}
}
}
Expand Down

0 comments on commit 0cc4dac

Please sign in to comment.