From fb8940583e4e8c985f2454da4ea7dd0376bb2e0b Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Thu, 17 Oct 2019 12:35:21 -0700 Subject: [PATCH] Make SetPosition and SetOrientation do nothing if all values are "default" placeholder --- xpcPlugin/DataManager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xpcPlugin/DataManager.cpp b/xpcPlugin/DataManager.cpp index 6e66abb..09f57ed 100644 --- a/xpcPlugin/DataManager.cpp +++ b/xpcPlugin/DataManager.cpp @@ -668,6 +668,11 @@ namespace XPC return; } + if (IsDefault(pos[0]) && IsDefault(pos[1]) && IsDefault(pos[2])) + { + Log::WriteLine(LOG_INFO, "DMAN", "Skipped SetPosition. All values were default"); + return; + } if (IsDefault(pos[0])) { pos[0] = GetDouble(DREF_Latitude, aircraft); @@ -718,6 +723,12 @@ namespace XPC return; } + + if (IsDefault(orient[0]) && IsDefault(orient[1]) && IsDefault(orient[2])) + { + Log::WriteLine(LOG_INFO, "DMAN", "Skipped SetPosition. All values were default"); + return; + } if (IsDefault(orient[0])) { orient[0] = GetFloat(DREF_Pitch, aircraft);