From 4feaf27193d60a2f32dde0455ce31ca69d3e1ef7 Mon Sep 17 00:00:00 2001 From: Lok Lam Date: Sun, 31 Jul 2016 14:17:32 +0800 Subject: [PATCH 1/2] workaround empty forts --- pokemongo_bot/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index a8816141f2..616623fe60 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -94,6 +94,9 @@ def get_meta_cell(self): cells = self.find_close_cells(*location) # Combine all cells into a single dict of the items we care about. + oldForts = [] + if (self.cell and "forts" in self.cell): + oldForts = self.cell['forts'] forts = [] wild_pokemons = [] catchable_pokemons = [] @@ -105,6 +108,10 @@ def get_meta_cell(self): if "catchable_pokemons" in cell and len(cell["catchable_pokemons"]): catchable_pokemons += cell["catchable_pokemons"] + if (len(forts) == 0): + forts = oldForts + logger.log('using old forts list') + return { "forts": forts, "wild_pokemons": wild_pokemons, From 78952c2047b1e5db5fe7a289a66ecc8387c61c5a Mon Sep 17 00:00:00 2001 From: Lok Lam Date: Sun, 31 Jul 2016 14:31:57 +0800 Subject: [PATCH 2/2] workarund empty forts --- pokemongo_bot/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index dc825a4f2e..e8b5c12a4e 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -111,7 +111,7 @@ def get_meta_cell(self): if (len(forts) == 0): forts = oldForts - logger.log('using old forts list') +# logger.log('using old forts list') return { "forts": forts,