Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit d0eccdd

Browse files
committed
Issue #31. Fix an issue with called meld wrong log messages
1 parent 36bb15a commit d0eccdd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

project/tenhou/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,15 @@ def start_game(self):
320320
# we had to do discard after this
321321
if meld.who == 0:
322322
if meld.type != Meld.KAN and meld.type != Meld.CHANKAN:
323-
logger.info('With hand: {}'.format(main_player.format_hand_for_print(meld_tile)))
323+
player_formatted_hand = main_player.format_hand_for_print(meld_tile)
324+
discarded_tile = self.player.discard_tile(discard_option)
325+
326+
logger.info('With hand: {}'.format(player_formatted_hand))
324327
logger.info('Discard tile after called meld: {}'.format(
325-
TilesConverter.to_one_line_string([discard_option.tile_to_discard])))
328+
TilesConverter.to_one_line_string([discarded_tile]))
329+
)
326330

327331
self.player.tiles.append(meld_tile)
328-
discarded_tile = self.player.discard_tile(discard_option)
329-
330332
self._send_message('<D p="{}"/>'.format(discarded_tile))
331333

332334
win_suggestions = ['t="8"', 't="9"', 't="12"', 't="13"']

0 commit comments

Comments
 (0)