X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=qchess%2Fsrc%2Fgame.py;fp=qchess%2Fsrc%2Fgame.py;h=4eebc76af62acbee1f8113fa9f476383300ebc46;hb=a6d91c8bb286fa91f9e2a56b304043ff48154322;hp=16f26d72a8699d78f170aa87ac0f5191829f80d4;hpb=3decbfd61b59ee2611700e7fa96368e02f643d4d;p=progcomp2013.git diff --git a/qchess/src/game.py b/qchess/src/game.py index 16f26d7..4eebc76 100644 --- a/qchess/src/game.py +++ b/qchess/src/game.py @@ -180,6 +180,8 @@ class ReplayThread(GameThread): if self.stopped(): break + if len(line) <= 0: + continue if line[0] == '#': @@ -227,7 +229,10 @@ class ReplayThread(GameThread): self.board.update_select(x, y, int(tokens[2]), tokens[len(tokens)-1]) if isinstance(graphics, GraphicsThread): with graphics.lock: - graphics.state["moves"] = self.board.possible_moves(target) + if target.current_type != "unknown": + graphics.state["moves"] = self.board.possible_moves(target) + else: + graphics.state["moves"] = None time.sleep(turn_delay) else: self.board.update_move(x, y, x2, y2)