diff --git a/db.py b/db.py index feb015b..5e9de69 100644 --- a/db.py +++ b/db.py @@ -306,6 +306,8 @@ class Game(db.Model): def restart_jeu(self): if (self.turn==0 and (self.atout=='' or self.atout is None)) or self.turn==N_TURN*N_PLAYERS: + if self.turn>0: + self.partie +=1 self.turn = -8 self.atout = None self.preneur = None @@ -315,8 +317,6 @@ class Game(db.Model): self.cumul_1 += self.points_1 self.points_0 = 0 self.points_1 = 0 - if self.turn>0: - self.partie +=1 self.first_player = 0 self.distribute() db.session.commit() diff --git a/static/game_script.js b/static/game_script.js index acd8c11..adc9083 100644 --- a/static/game_script.js +++ b/static/game_script.js @@ -154,7 +154,11 @@ var set_current_player = function(){ if(jeu['turn']==32 && jeu['admin']==jeu['players'][jeu['nr']]){ $('#suivant').show(); } - if(jeu['turn']==0 && (jeu['atout'] == null||jeu['atout']=='') && jeu['admin']==jeu['players'][jeu['nr']]){ + else if(jeu['turn']==0 && (jeu['atout'] == null||jeu['atout']=='') && jeu['admin']==jeu['players'][jeu['nr']]){ + $('#suivant').show(); + } + else + { $('#suivant').show(); } } diff --git a/templates/admin_games.html b/templates/admin_games.html index c62bc6e..a489184 100644 --- a/templates/admin_games.html +++ b/templates/admin_games.html @@ -6,7 +6,7 @@ {% block contenu %}