From 0f3aa98d35b9632fade7cf05d3a24963feb48f2d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 1 Mar 2019 18:11:01 +0100 Subject: [PATCH] huh --- db.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db.py b/db.py index 01d00fab..8c54b181 100644 --- a/db.py +++ b/db.py @@ -1342,8 +1342,11 @@ class Brawlhalla(Base, Mini): self.rating = rating.value best_team_data = Dirty((self.best_team_partner_id, self.best_team_rating)) try: - current_best_team = max(j.get("2v2", []), key=lambda t: j.get("rating", 0)) - self.best_team_partner_id = current_best_team["brawlhalla_id_two"] + current_best_team = max(j.get("2v2", []), key=lambda t: t.get("rating", 0)) + if current_best_team["brawlhalla_id_one"] == self.brawlhalla_id: + self.best_team_partner_id = current_best_team["brawlhalla_id_two"] + else: + self.best_team_partner_id = current_best_team["brawlhalla_id_one"] self.best_team_rating = current_best_team["rating"] best_team_data.value = (self.best_team_partner_id, self.best_team_rating) except ValueError: