draw method reset draw counter on empty deck

This commit is contained in:
Jannes Höke 2016-05-21 18:55:53 +02:00
parent d5b76c5c12
commit 73365f49fc

View file

@ -112,9 +112,14 @@ class Player(object):
"""Draws 1+ cards from the deck, depending on the draw counter""" """Draws 1+ cards from the deck, depending on the draw counter"""
_amount = self.game.draw_counter or 1 _amount = self.game.draw_counter or 1
try:
for i in range(_amount): for i in range(_amount):
self.cards.append(self.game.deck.draw()) self.cards.append(self.game.deck.draw())
except DeckEmptyError:
raise
finally:
self.game.draw_counter = 0 self.game.draw_counter = 0
self.drew = True self.drew = True