Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pokemongo_bot/step_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, bot, speed, initLat, initLng, destLat, destLng):

self.steps = (dist + 0.0) / (speed + 0.0)

if dist < 0.01 or self.steps < 1:
if dist < speed or self.steps < 1:
self.dLat = 0
self.dLng = 0
self.magnitude = 0;
Expand All @@ -44,7 +44,8 @@ def step(self):
# print 'distance'
# print dist

if (self.dLat == 0 and self.dLng == 0) or dist < 15:
if (self.dLat == 0 and self.dLng == 0) or dist < self.speed:
Copy link
Contributor

@elicwhite elicwhite Jul 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstumm I think dist < self.speeed isn't going to work correctly. Since random_lat_long_delta() returns something between -9.1 and 9.1, we really need something like self.speed < dist + 9.1 Otherwise we could walk past and go on for ever.

self.api.set_position(self.destLat, self.destLng, 0)
return True

totalDLat = (self.destLat - i2f(self.api._position_lat))
Expand Down