From 847154d80805377a9c638871b3317b26ae6e0b4c Mon Sep 17 00:00:00 2001 From: Dmitry Ovodov Date: Thu, 11 Aug 2016 11:09:23 +0700 Subject: [PATCH] Fix error when MoveToFort called from handle_soft_ban.py (#3500) * Fix error when MoveToFort called from handle_soft_ban.py * Added myself to CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + pokemongo_bot/cell_workers/move_to_fort.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a963396fcb..fc2478f20c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -61,3 +61,4 @@ * JaapMoolenaar * eevee-github * g0vanish + * cmezh diff --git a/pokemongo_bot/cell_workers/move_to_fort.py b/pokemongo_bot/cell_workers/move_to_fort.py index 2be287e86c..24ecf5e74a 100644 --- a/pokemongo_bot/cell_workers/move_to_fort.py +++ b/pokemongo_bot/cell_workers/move_to_fort.py @@ -13,9 +13,13 @@ class MoveToFort(BaseTask): def initialize(self): self.lure_distance = 0 - self.lure_attraction = self.config.get("lure_attraction", True) - self.lure_max_distance = self.config.get("lure_max_distance", 2000) - self.ignore_item_count = self.config.get("ignore_item_count", False) + if self.config: + self.lure_attraction = self.config.get("lure_attraction", True) + self.lure_max_distance = self.config.get("lure_max_distance", 2000) + self.ignore_item_count = self.config.get("ignore_item_count", False) + else: + self.lure_attraction = None + self.ignore_item_count = True def should_run(self): has_space_for_loot = self.bot.has_space_for_loot()