little change on the pokestop navigation
little change on the pokestop navigation
diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs
index 01ea3cd..1bbe5d6 100644
--- a/PokemonGo.RocketAPI.Logic/Logic.cs
+++ b/PokemonGo.RocketAPI.Logic/Logic.cs
@@ -156,16 +156,19 @@ namespace PokemonGo.RocketAPI.Logic
i =>
i.Type == FortType.Checkpoint &&
i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime() &&
- ( // Make sure PokeStop is within max travel distance, unless it's set to 0.
+ (_clientSettings.MaxTravelDistanceInMeters == 0 ||
LocationUtils.CalculateDistanceInMeters(
_clientSettings.DefaultLatitude, _clientSettings.DefaultLongitude,
- i.Latitude, i.Longitude) < _clientSettings.MaxTravelDistanceInMeters) ||
- _clientSettings.MaxTravelDistanceInMeters == 0
- )
+ i.Latitude, i.Longitude) < _clientSettings.MaxTravelDistanceInMeters))
.OrderBy(
i =>
LocationUtils.CalculateDistanceInMeters(_client.CurrentLat, _client.CurrentLng, i.Latitude, i.Longitude)).ToArray());
-
+ var pokestopList = pokeStops.ToList();
+ if (pokestopList.Count <= 0)
+ {
+ Logger.Write($"No PokeStops within {_clientSettings.MaxTravelDistanceInMeters}m. Choose a different GPS location or increase MaxTravelDistanceInMeters.", LogLevel.Error);
+ return;
+ }
Logger.Write($"Found {pokeStops.Count()} pokestops", LogLevel.None, ConsoleColor.Green);
foreach (var pokeStop in pokeStops)
diff --git a/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj b/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
index 570dacc..4eeba5a 100644
--- a/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
+++ b/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
@@ -17,7 +17,7 @@
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
<AssemblyVersionSettings>YearStamp.MonthStamp.DayStamp.Increment</AssemblyVersionSettings>
<PrimaryVersionType>AssemblyVersionAttribute</PrimaryVersionType>
- <AssemblyVersion>2016.7.24.275</AssemblyVersion>
+ <AssemblyVersion>2016.7.24.276</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
You may download the files in Public Git.