Fix for FTP Razz crasher

When a player is listed as playing the hand and sits out between the listing and ante-up join_holecards returned only 2 cards causing Card.encodeRazzStartHand() to crash.

Make sure that join_holecards must return at least 3 cards for stud, and add an entry for this case in the lookup table
This commit is contained in:
Worros
2010-12-11 01:26:56 +08:00
parent 5a5ab451d1
commit caa2104fa9
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -1580,6 +1580,11 @@ Add a complete on [street] by [player] to [amountTo]
else:
log.warning(_("join_holecards: # of holecards should be either < 4, 4 or 7 - 5 and 6 should be impossible for anyone who is not a hero"))
log.warning(_("join_holcards: holecards(%s): %s") %(player, holecards))
if holecards == [u'0x', u'0x']:
log.warning(_("join_holecards: Player '%s' appears not to have been dealt a card"))
# If a player is listed but not dealt a card in a cash game this can occur
# Noticed in FTP Razz hand. Return 3 empty cards in this case
holecards = [u'0x', u'0x', u'0x']
return holecards