prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bot unnecessarily walks to center of Pokestops
  This issue may also increase detectability since it's unlikely that users would walk to the exact center of every stop they visit.
  
  Also, most stops are spinnable from the road or other more accessible place. Once we start following roads, this will need fixed.
  ### Expected Behavior
  
  Bot should walk to anywhere within the range of the stop.
  ### Actual Behavior
  
  Bot walks to exactly the center of a stop.
  ### Steps to Reproduce
  
  Run the bot and observe its path.
  
  
  </issue>
  <code>
  [start of pokemongo_bot/cell_workers/move_to_fort_worker.py]
  1 from utils import distance, format_dist
  2 from pokemongo_bot.human_behaviour import sleep
  3 from pokemongo_bot import logger
  4 from pokemongo_bot.step_walker import StepWalker
  5 
  6 class MoveToFortWorker(object):
  7     def __init__(self, fort, bot):
  8         self.bot = bot
  9         self.fort = fort
  10         self.api = bot.api
  11         self.config = bot.config
  12         self.navigator = bot.navigator
  13         self.position = bot.position
  14 
  15     def work(self):
  16         lat = self.fort['latitude']
  17         lng = self.fort['longitude']
  18         fortID = self.fort['id']
  19         unit = self.config.distance_unit  # Unit to use when printing formatted distance
  20 
  21         dist = distance(self.position[0], self.position[1], lat, lng)
  22 
  23         # print('Found fort {} at distance {}m'.format(fortID, dist))
  24         logger.log('Found fort {} at distance {}'.format(
  25             fortID, format_dist(dist, unit)))
  26 
  27         if dist > 10:
  28             logger.log('Need to move closer to Pokestop')
  29             position = (lat, lng, 0.0)
  30 
  31             if self.config.walk > 0:
  32                 step_walker = StepWalker(
  33                     self.bot,
  34                     self.config.walk,
  35                     self.api._position_lat,
  36                     self.api._position_lng,
  37                     position[0],
  38                     position[1]
  39                 )
  40 
  41                 while True:
  42                     if step_walker.step():
  43                         break
  44 
  45             else:
  46                 self.api.set_position(*position)
  47 
  48             self.api.player_update(latitude=lat, longitude=lng)
  49             response_dict = self.api.call()
  50             logger.log('Arrived at Pokestop')
  51             sleep(2)
  52             return response_dict
  53 
  54         return None
  55
  [end of pokemongo_bot/cell_workers/move_to_fort_worker.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/pokemongo_bot/cell_workers/move_to_fort_worker.py b/pokemongo_bot/cell_workers/move_to_fort_worker.py
  --- a/pokemongo_bot/cell_workers/move_to_fort_worker.py
  +++ b/pokemongo_bot/cell_workers/move_to_fort_worker.py
  @@ -1,4 +1,4 @@
  -from utils import distance, format_dist
  +from utils import distance, format_dist, i2f
   from pokemongo_bot.human_behaviour import sleep
   from pokemongo_bot import logger
   from pokemongo_bot.step_walker import StepWalker
  @@ -38,7 +38,7 @@
                       position[1]
                   )
   
  -                while True:
  +                while distance(i2f(self.api._position_lat), i2f(self.api._position_lng), lat, lng) > 10:
                       if step_walker.step():
                           break
  
verification_info: {"golden_diff": "diff --git a/pokemongo_bot/cell_workers/move_to_fort_worker.py b/pokemongo_bot/cell_workers/move_to_fort_worker.py\n--- a/pokemongo_bot/cell_workers/move_to_fort_worker.py\n+++ b/pokemongo_bot/cell_workers/move_to_fort_worker.py\n@@ -1,4 +1,4 @@\n-from utils import distance, format_dist\n+from utils import distance, format_dist, i2f\n from pokemongo_bot.human_behaviour import sleep\n from pokemongo_bot import logger\n from pokemongo_bot.step_walker import StepWalker\n@@ -38,7 +38,7 @@\n                     position[1]\n                 )\n \n-                while True:\n+                while distance(i2f(self.api._position_lat), i2f(self.api._position_lng), lat, lng) > 10:\n                     if step_walker.step():\n                         break\n", "issue": "Bot unnecessarily walks to center of Pokestops\nThis issue may also increase detectability since it's unlikely that users would walk to the exact center of every stop they visit.\n\nAlso, most stops are spinnable from the road or other more accessible place. Once we start following roads, this will need fixed.\n### Expected Behavior\n\nBot should walk to anywhere within the range of the stop.\n### Actual Behavior\n\nBot walks to exactly the center of a stop.\n### Steps to Reproduce\n\nRun the bot and observe its path.\n\n", "before_files": [{"content": "from utils import distance, format_dist\nfrom pokemongo_bot.human_behaviour import sleep\nfrom pokemongo_bot import logger\nfrom pokemongo_bot.step_walker import StepWalker\n\nclass MoveToFortWorker(object):\n    def __init__(self, fort, bot):\n        self.bot = bot\n        self.fort = fort\n        self.api = bot.api\n        self.config = bot.config\n        self.navigator = bot.navigator\n        self.position = bot.position\n\n    def work(self):\n        lat = self.fort['latitude']\n        lng = self.fort['longitude']\n        fortID = self.fort['id']\n        unit = self.config.distance_unit  # Unit to use when printing formatted distance\n\n        dist = distance(self.position[0], self.position[1], lat, lng)\n\n        # print('Found fort {} at distance {}m'.format(fortID, dist))\n        logger.log('Found fort {} at distance {}'.format(\n            fortID, format_dist(dist, unit)))\n\n        if dist > 10:\n            logger.log('Need to move closer to Pokestop')\n            position = (lat, lng, 0.0)\n\n            if self.config.walk > 0:\n                step_walker = StepWalker(\n                    self.bot,\n                    self.config.walk,\n                    self.api._position_lat,\n                    self.api._position_lng,\n                    position[0],\n                    position[1]\n                )\n\n                while True:\n                    if step_walker.step():\n                        break\n\n            else:\n                self.api.set_position(*position)\n\n            self.api.player_update(latitude=lat, longitude=lng)\n            response_dict = self.api.call()\n            logger.log('Arrived at Pokestop')\n            sleep(2)\n            return response_dict\n\n        return None\n", "path": "pokemongo_bot/cell_workers/move_to_fort_worker.py"}]}