From 2efc89916913aaaadc47bf8a54b5ad9ec1349bd5 Mon Sep 17 00:00:00 2001 From: rawgni Date: Thu, 1 Sep 2016 10:26:24 +0700 Subject: [PATCH] fix #5019 --- .../cell_workers/collect_level_up_reward.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pokemongo_bot/cell_workers/collect_level_up_reward.py b/pokemongo_bot/cell_workers/collect_level_up_reward.py index ccfe0401ae..1696d99049 100644 --- a/pokemongo_bot/cell_workers/collect_level_up_reward.py +++ b/pokemongo_bot/cell_workers/collect_level_up_reward.py @@ -62,13 +62,11 @@ def _collect_level_reward(self): item['name'] = got_item count = 'item_count' in item and item['item_count'] or 0 inventory.items().get(item['item_id']).add(count) - try: - self.emit_event( - 'level_up_reward', - formatted='Received level up reward: {items}', - data={ - 'items': ', '.join(["{}x {}".format(data[x], x) for x in data]) - } - ) - except TypeError: - pass + self.emit_event( + 'level_up_reward', + formatted='Received level up reward: {items}', + data={ + # [{'item_id': 3, 'name': u'Ultraball', 'item_count': 10}, {'item_id': 103, 'name': u'Hyper Potion', 'item_count': 10}] + 'items': ', '.join(["{}x {}".format(x['item_count'], x['name']) for x in data]) + } + )