Skip to content

Commit

Permalink
Don't send position data if both lat and long is 0
Browse files Browse the repository at this point in the history
Flight Simulator 2020 sends position data if you ask for it, even if you're just poking around in the main menu. When you're not flying or at an airport the coordinates being sent are 00N000W. By filtering these packets out, the chances of getting garbage in your flight log are diminished.
  • Loading branch information
astenlund committed Nov 15, 2020
1 parent 050f07e commit 60dc1c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private async Task SimConnectAttitudeReceived(Attitude att)

private async Task SimConnectPositionReceived(Position pos)
{
if (DataPositionEnabled)
if (DataPositionEnabled && (pos.Latitude != 0d || pos.Longitude != 0d))
{
await _dataSender.Send(pos).ConfigureAwait(false);
}
Expand Down

0 comments on commit 60dc1c1

Please sign in to comment.