From eaf56766362025045f56ee3f6fa4d4682dfd5df2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Jan 2017 09:55:14 +1100 Subject: [PATCH] SITL: fixed unselection bitmask bug in XPlane --- libraries/SITL/SIM_XPlane.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/SITL/SIM_XPlane.cpp b/libraries/SITL/SIM_XPlane.cpp index 09c4c9e341..7729655ffc 100644 --- a/libraries/SITL/SIM_XPlane.cpp +++ b/libraries/SITL/SIM_XPlane.cpp @@ -287,8 +287,13 @@ bool XPlane::receive_data(void) if (data_mask != required_mask) { // ask XPlane to change what data it sends - select_data(data_mask & ~required_mask, required_mask & ~data_mask); - goto failed; + uint64_t usel = data_mask & ~required_mask; + uint64_t sel = required_mask & ~data_mask; + usel &= ~unselected_mask; + if (usel || sel) { + select_data(usel, sel); + goto failed; + } } position = pos + position_zero; update_position();