diff options
-rw-r--r-- | lib/Bot/Zulip/Chess.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bot/Zulip/Chess.pm b/lib/Bot/Zulip/Chess.pm index 1c9ddc9..321e393 100644 --- a/lib/Bot/Zulip/Chess.pm +++ b/lib/Bot/Zulip/Chess.pm @@ -94,6 +94,10 @@ has _chessboard => ( $board->go_move($white) if $white; $board->go_move($black) if $black; } + my $status = $board->status; + if ($status->{mate} || $status->{stalemate}) { + die "Game is over"; + } } catch { warn $_; |