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

Commit 18bfb00

Browse files
committed
Improve open meld formatting a little bit
1 parent 74b3df1 commit 18bfb00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

project/tenhou/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ def start_game(self):
312312

313313
# set was called
314314
if '<N who=' in message:
315+
player_formatted_hand = ''
316+
if meld_tile:
317+
player_formatted_hand = main_player.format_hand_for_print(meld_tile)
318+
315319
meld = self.decoder.parse_meld(message)
316320
self.table.add_called_meld(meld.who, meld)
317321
logger.info('Meld: {} by {}'.format(meld, meld.who))
@@ -320,7 +324,6 @@ def start_game(self):
320324
# we had to do discard after this
321325
if meld.who == 0:
322326
if meld.type != Meld.KAN and meld.type != Meld.CHANKAN:
323-
player_formatted_hand = main_player.format_hand_for_print(meld_tile)
324327
discarded_tile = self.player.discard_tile(discard_option)
325328

326329
logger.info('With hand: {}'.format(player_formatted_hand))

0 commit comments

Comments
 (0)