Skip to content

Commit 8213a2e

Browse files
committed
Don't allow analysis if checkmate/stalemate
1 parent f69b7cd commit 8213a2e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/boardui.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function EnsureAnalysisStopped() {
3737
}
3838

3939
function UIAnalyzeToggle() {
40+
if (GenerateValidMoves().length == 0) {
41+
UpdatePVDisplay(g_inCheck ? "Checkmate" : "Stalemate");
42+
return;
43+
}
44+
4045
if (InitializeBackgroundEngine()) {
4146
if (!g_analyzing) {
4247
g_backgroundEngine.postMessage("analyze");

0 commit comments

Comments
 (0)