summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-27 07:37:42 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:41:36 (GMT)
commita427956e5b232775fd7846e583af4a1e28e305cd (patch)
tree8efb050ad56e8e2d80850e623b232c81b505af5e
parent31eb5919990d99b3de497894564f4de0a4aad64f (diff)
Hand.__arrange(): if no winning arrangement is found, do not set hand.mjRule
-rw-r--r--src/hand.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hand.py b/src/hand.py
index 81603da..e337d88 100644
--- a/src/hand.py
+++ b/src/hand.py
@@ -628,7 +628,8 @@ class Hand(object):
# we prefer a won Hand even if a lost Hand might have a higher score
tryHands = wonHands if wonHands else lostHands
bestRule, bestVariant, _ = max(tryHands, key=lambda x: x[2])
- self.mjRule = bestRule
+ if wonHands:
+ self.mjRule = bestRule
self.melds.extend(bestVariant)
self.melds.sort()
self.__rest = []