fix play outside turn

This commit is contained in:
Alberto Xamin 2020-11-28 17:13:35 +01:00
parent 674d284ab1
commit 1d56ffbcca
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -249,8 +249,9 @@ class Player:
return s
def play_card(self, hand_index: int, against=None, _with=None):
if not self.is_my_turn or self.pending_action != PendingAction.PLAY:
return
if not (0 <= hand_index < len(self.hand) + len(self.equipment)):
print('illegal')
return
card: cs.Card = self.hand.pop(hand_index) if hand_index < len(self.hand) else self.equipment.pop(hand_index-len(self.hand))
withCard: cs.Card = None