Skip to content

Commit

Permalink
Fix: Correct usage of walker_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
novadev94 committed Aug 19, 2016
1 parent e7c4bc0 commit 56e5b1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pokemongo_bot/walkers/polyline_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ class PolylineWalker(StepWalker):
Heavy multi-botting can cause issue, since the directions API has limits.
'''

def __init__(self, bot, speed, dest_lat, dest_lng, parent):
super(PolylineWalker, self).__init__(bot, speed, dest_lat, dest_lng)
def __init__(self, bot, dest_lat, dest_lng, parent):
super(PolylineWalker, self).__init__(bot, dest_lat, dest_lng)
self.polyline_walker = PolylineObjectHandler.cached_polyline(bot, (self.api._position_lat, self.api._position_lng),
(self.destLat, self.destLng), self.speed, parent)

self.dist = distance(
self.bot.position[0],
self.bot.position[1],
Expand Down
8 changes: 4 additions & 4 deletions pokemongo_bot/walkers/walker_factory.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from pokemongo_bot.walkers.polyline_walker import PolylineWalker
from pokemongo_bot.walkers.step_walker import StepWalker

def walker_factory(name, bot, speed, dest_lat, dest_lng, *args, **kwargs):
def walker_factory(name, bot, dest_lat, dest_lng, *args, **kwargs):
'''
Charlie and the Walker Factory
'''
if 'StepWalker' == name:
ret = StepWalker(bot, speed, dest_lat, dest_lng)
ret = StepWalker(bot, dest_lat, dest_lng)
elif 'PolylineWalker' == name:
try:
ret = PolylineWalker(bot, speed, dest_lat, dest_lng, *args, **kwargs)
ret = PolylineWalker(bot, dest_lat, dest_lng, *args, **kwargs)
except:
ret = StepWalker(bot, speed, dest_lat, dest_lng)
ret = StepWalker(bot, dest_lat, dest_lng)
return ret

0 comments on commit 56e5b1f

Please sign in to comment.