From 988878502cf41befdd3d57a337964541c814a9aa Mon Sep 17 00:00:00 2001 From: Eden Kirin Date: Tue, 28 Mar 2023 09:45:49 +0200 Subject: [PATCH] Hide inactive players from board dump --- hopper/engine.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hopper/engine.py b/hopper/engine.py index a0c9cc0..01ea11f 100644 --- a/hopper/engine.py +++ b/hopper/engine.py @@ -35,9 +35,12 @@ class GameEngine: dump = self.board.dump() for player in self.players: - if player.position.y < len(dump) and player.position.x < len( - dump[player.position.y] - ): + show_player = ( + player.active + and player.position.y < len(dump) + and player.position.x < len(dump[player.position.y]) + ) + if show_player: dump[player.position.y][player.position.x] = BOARD_DUMP_CHARS[ ObjectType.PLAYER ]