Skip to content

Commit

Permalink
check mate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jezek committed Jan 21, 2019
1 parent db0334e commit c5e2117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model.go
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ func (ch *ChessGame) UpdateModel(tools *shf.Tools, m *HtmlModel, execSupported b
if position.Check(m.Board.Grid.Squares[i].Piece.Color) {
m.Board.Grid.Squares[i].Markers.Check = true

if ch.game.Status() == game.WhiteWon|game.BlackWon {
if ch.game.Status()&(game.WhiteWon|game.BlackWon) > 0 {
// game ended with whith someone winning, has to be check mate
m.Board.Grid.Squares[i].Markers.Mate = true
}
Expand Down

0 comments on commit c5e2117

Please sign in to comment.