From ba150ede071da7b03d829022d8a0bcf3818e3478 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sun, 16 May 2021 01:42:48 +0200 Subject: [PATCH] fix fratelli di sangue the start of a game turn was printed twice in the chat --- backend/bang/players.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/bang/players.py b/backend/bang/players.py index d27b301..c4bbbd3 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -313,16 +313,17 @@ class Player: else: self.choose(randrange(0, len(target.hand)+len(target.equipment))) - def play_turn(self, can_play_vendetta = True): + def play_turn(self, can_play_vendetta = True, again = False): if (self.lives == 0 or self.is_dead) and not self.is_ghost: return self.end_turn(forced=True) self.scrapped_cards = 0 self.can_play_ranch = True self.is_playing_ranch = False self.can_play_vendetta = can_play_vendetta - self.sio.emit('chat_message', room=self.game.name, - data=f'_turn|{self.name}') - print(f'{self.name}: I was notified that it is my turn') + if not again: + self.sio.emit('chat_message', room=self.game.name, + data=f'_turn|{self.name}') + print(f'{self.name}: I was notified that it is my turn') self.was_shot = False self.is_my_turn = True self.is_waiting_for_action = True @@ -592,7 +593,7 @@ class Player: player.notify_self() self.sio.emit('chat_message', room=self.game.name, data=f'_fratelli_sangue|{self.name}|{player.name}') except: pass - self.play_turn() + self.play_turn(again = True) elif self.is_using_checchino and self.game.check_event(ce.Cecchino): try: if self.available_cards[card_index]['name'] != '':