Skip to content

Commit

Permalink
Fix failure to report game over regression
Browse files Browse the repository at this point in the history
Resolves #35
  • Loading branch information
trevorbayless committed Dec 7, 2024
1 parent 1f5f542 commit debd811
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cli_chess/modules/board/board_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def make_move(self, move: str, notify=True) -> chess.Move:

if notify:
log.debug(f"Made move ({move})")
self._notify_board_model_updated(EventTopics.MOVE_MADE)
if not self.is_game_over():
self._notify_board_model_updated(EventTopics.MOVE_MADE)
else:
self._notify_board_model_updated(EventTopics.MOVE_MADE, EventTopics.GAME_END)
except Exception as e:
log.error(e)
if isinstance(e, chess.InvalidMoveError):
Expand Down

0 comments on commit debd811

Please sign in to comment.