Skip to content

Commit

Permalink
fixing loop in spin fort task (#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascamata authored and solderzzc committed Aug 9, 2016
1 parent 597196e commit ec3babc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pokemongo_bot/cell_workers/spin_fort.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ def work(self):
def get_fort_in_range(self):
forts = self.bot.get_forts(order_by_distance=True)

for fort in forts:
if 'cooldown_complete_timestamp_ms' in fort:
self.bot.fort_timeouts[fort["id"]] = fort['cooldown_complete_timestamp_ms']
forts.remove(fort)

forts = filter(lambda x: x["id"] not in self.bot.fort_timeouts, forts)

if len(forts) == 0:
Expand Down

0 comments on commit ec3babc

Please sign in to comment.