From 4d4c768fd5fa8c6b444046b68ba2ab968fdcf2e2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 6 Aug 2010 12:11:18 +0800 Subject: [PATCH] plugin tarot: fixed bad score calculation --- plugins/plugin_misc_tarot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/plugin_misc_tarot.py b/plugins/plugin_misc_tarot.py index 9ea03ecf..7001b55f 100755 --- a/plugins/plugin_misc_tarot.py +++ b/plugins/plugin_misc_tarot.py @@ -272,7 +272,7 @@ class Tarot(): bouts.append(card.value) score += card.points - #We now check if there is no bug in score calculation + #We we do a basic check on score calculation check_score = 0 defenseurs = game_data['players'][:] defenseurs.remove(game_data['attaquant']) @@ -302,11 +302,12 @@ class Tarot(): elif game_data['contrat'] == 'Garde Contre': contrat_mult = 6 else: - error(_('Internal error: contrat not managed (mispelled ?)')) + error(_('INTERNAL ERROR: contrat not managed (mispelled ?)')) + assert(False) victory = (score >= point_limit) - margin = score - point_limit - points_defenseur = (-margin + 25) * contrat_mult + margin = abs(score - point_limit) + points_defenseur = (margin + 25) * contrat_mult * (-1 if victory else 1) winners = [] loosers = [] player_score = {}