Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use InvariantCulture to parse GPX values #486

Merged
merged 1 commit into from
Jul 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions PoGo.NecroBot.Logic/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using PoGo.NecroBot.Logic.Utils;
using PokemonGo.RocketAPI;
using POGOProtos.Networking.Responses;
using System.Globalization;

#endregion

Expand Down Expand Up @@ -88,7 +89,7 @@ public async Task<PlayerUpdateResponse> HumanPathWalking(GpxReader.Trkpt trk,
{
//PlayerUpdateResponse result = null;

var targetLocation = new GeoCoordinate(Convert.ToDouble(trk.Lat), Convert.ToDouble(trk.Lon));
var targetLocation = new GeoCoordinate(Convert.ToDouble(trk.Lat, CultureInfo.InvariantCulture), Convert.ToDouble(trk.Lon, CultureInfo.InvariantCulture));

var speedInMetersPerSecond = walkingSpeedInKilometersPerHour/3.6;

Expand All @@ -99,7 +100,7 @@ public async Task<PlayerUpdateResponse> HumanPathWalking(GpxReader.Trkpt trk,
var nextWaypointBearing = LocationUtils.DegreeBearing(sourceLocation, targetLocation);
var nextWaypointDistance = speedInMetersPerSecond;
var waypoint = LocationUtils.CreateWaypoint(sourceLocation, nextWaypointDistance, nextWaypointBearing,
Convert.ToDouble(trk.Ele));
Convert.ToDouble(trk.Ele, CultureInfo.InvariantCulture));

//Initial walking

Expand Down
5 changes: 3 additions & 2 deletions PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using PoGo.NecroBot.Logic.Utils;
using PokemonGo.RocketAPI.Extensions;
using POGOProtos.Map.Fort;
using System.Globalization;

#endregion

Expand Down Expand Up @@ -37,8 +38,8 @@ public static void Execute(Context ctx, StateMachine machine)
{
var nextPoint = trackPoints.ElementAt(curTrkPt);
var distance = LocationUtils.CalculateDistanceInMeters(ctx.Client.CurrentLatitude,
ctx.Client.CurrentLongitude, Convert.ToDouble(nextPoint.Lat),
Convert.ToDouble(nextPoint.Lon));
ctx.Client.CurrentLongitude, Convert.ToDouble(nextPoint.Lat, CultureInfo.InvariantCulture),
Convert.ToDouble(nextPoint.Lon, CultureInfo.InvariantCulture));

if (distance > 5000)
{
Expand Down