diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 390e5bc194..d2a2ac8ef1 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -422,12 +422,11 @@ def _set_starting_position(self): logger.log('GeoPosition: {}'.format(self.position)) logger.log('') has_position = True - return except: logger.log('[x] The location given using -l could not be parsed. Checking for a cached location.') pass - if self.config.location_cache and not has_position: + if self.config.location_cache: try: # # save location flag used to pull the last known location from @@ -438,7 +437,7 @@ def _set_starting_position(self): location_json = json.load(f) location = (location_json['lat'], location_json['lng'], 0.0) - print(location) + #print(location) self.api.set_position(*location) logger.log('') @@ -452,8 +451,11 @@ def _set_starting_position(self): has_position = True return except: - sys.exit( - "No cached Location. Please specify initial location.") + if(has_position == False): + sys.exit( + "No cached Location. Please specify initial location.") + logger.log('[x] Parsing cached location failed, try to use the initial location...') + pass def _get_pos_by_name(self, location_name): # Check if the given location is already a coordinate.