diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs index aed9521a7..d421e6d89 100644 --- a/PokemonGo.RocketAPI.Logic/Logic.cs +++ b/PokemonGo.RocketAPI.Logic/Logic.cs @@ -75,7 +75,7 @@ private async Task DisplayPlayerLevelInTitle(bool updateOnly = false) { var xpDifference = GetXPDiff(playerStat.Level); var message = - $"{playerName} | Level {playerStat.Level}: {playerStat.Experience - playerStat.PrevLevelXp - xpDifference}/{playerStat.NextLevelXp - playerStat.PrevLevelXp - xpDifference}XP"; + $"{playerName} | Level {playerStat.Level}: {playerStat.Experience - playerStat.PrevLevelXp - xpDifference}/{playerStat.NextLevelXp - playerStat.PrevLevelXp - xpDifference}XP Stardust: {_playerProfile.Profile.Currency.ToArray()[1].Amount}"; Console.Title = message; if (updateOnly == false) Logger.Write(message); @@ -478,4 +478,4 @@ private async Task DisplayHighests() } } } -} \ No newline at end of file +} diff --git a/PokemonGo.RocketAPI/Client.cs b/PokemonGo.RocketAPI/Client.cs index 612e18c58..81bfcd359 100644 --- a/PokemonGo.RocketAPI/Client.cs +++ b/PokemonGo.RocketAPI/Client.cs @@ -37,12 +37,24 @@ public Client(ISettings settings) { try { - SetCoordinates(Convert.ToDouble(latlng[0]), Convert.ToDouble(latlng[1]), + double temp_lat = Convert.ToDouble(latlng[0]); + double temp_long = Convert.ToDouble(latlng[1]); + + if(temp_lat >= -90 && temp_lat <= 90 && temp_long >= -180 && temp_long <= 180) + { + SetCoordinates(Convert.ToDouble(latlng[0]), Convert.ToDouble(latlng[1]), Settings.DefaultAltitude); + } + else + { + Logger.Write("Coordinates in \"Coords.txt\" file are invalid, using the default coordinates ", + LogLevel.Warning); + SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude); + } } catch (FormatException) { - Logger.Write("Coordinates in \"Coords.txt\" file is invalid, using the default coordinates ", + Logger.Write("Coordinates in \"Coords.txt\" file are invalid, using the default coordinates ", LogLevel.Warning); SetCoordinates(Settings.DefaultLatitude, Settings.DefaultLongitude, Settings.DefaultAltitude); } @@ -425,4 +437,4 @@ public async Task UseCaptureItem(ulong encounterId, ItemI useItemRequest); } } -} \ No newline at end of file +}