From 1b5b5f736f57c21499c6d0ebf2069fa1888fd5ca Mon Sep 17 00:00:00 2001 From: Eriks Karls Date: Fri, 27 Mar 2020 10:31:39 +0200 Subject: [PATCH] Multiple achievements are joined under one notification - use achievementAmount for count --- erepublik/__init__.py | 2 +- erepublik/citizen.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erepublik/__init__.py b/erepublik/__init__.py index 0c3dd11..a372e28 100644 --- a/erepublik/__init__.py +++ b/erepublik/__init__.py @@ -5,7 +5,7 @@ __author__ = """Eriks Karls""" __email__ = 'eriks@72.lv' __version__ = '0.20.0' -__commit_id__ = "d928ffc" +__commit_id__ = "4b4ed18" from erepublik import classes, utils from erepublik.citizen import Citizen diff --git a/erepublik/citizen.py b/erepublik/citizen.py index c08f644..0894850 100644 --- a/erepublik/citizen.py +++ b/erepublik/citizen.py @@ -2128,6 +2128,7 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenEconomy, CitizenLeade params: dict = medal.get('details', {}).get('achievement') about: str = medal.get('body') title: str = medal.get('title') + count: int = medal.get('details', {}).get('achievementAmount', 1) award_id: int = medal.get('id') if award_id and title and medal.get('details').get('isWallMaterial'): @@ -2144,10 +2145,10 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenEconomy, CitizenLeade currency = "Energy" if (title, reward) not in data: - data[(title, reward)] = {'about': about, 'kind': title, 'reward': reward, "count": 1, + data[(title, reward)] = {'about': about, 'kind': title, 'reward': reward, "count": count, "currency": currency, "params": params} else: - data[(title, reward)]['count'] += 1 + data[(title, reward)]['count'] += count self._post_main_global_alerts_close(medal.get('id')) if data: msgs = ["{count} x {kind},"