diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 3fd04997a8..65a13863e6 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -1058,14 +1058,14 @@ def get_pos_by_name(self, location_name): possible_coordinates = re.findall( "[-]?\d{1,3}[.]\d{3,7}", location_name ) - if len(possible_coordinates) == 2: + if len(possible_coordinates) >= 2: # 2 matches, this must be a coordinate. We'll bypass the Google # geocode so we keep the exact location. self.logger.info( '[x] Coordinates found in passed in location, ' 'not geocoding.' ) - return float(possible_coordinates[0]), float(possible_coordinates[1]), self.alt + return float(possible_coordinates[0]), float(possible_coordinates[1]), (float(possible_coordinates[2]) if len(possible_coordinates) == 3 else self.alt) geolocator = GoogleV3(api_key=self.config.gmapkey) loc = geolocator.geocode(location_name, timeout=10)