Fixed bug in handling of CTRL command

Several of the values were not checked for the "don't change" sentinel value.
This commit is contained in:
Jason Watkins
2015-05-05 10:23:03 -07:00
parent c6f9669e36
commit 01b55f97c4

View File

@@ -195,20 +195,33 @@ namespace XPC
spdbrk = *((float*)(buffer + 27));
}
float thrArray[8];
for (int i = 0; i < 8; ++i)
{
thrArray[i] = thr;
}
DataManager::Set(DREF_YokePitch, pitch, aircraft);
DataManager::Set(DREF_YokeRoll, roll, aircraft);
DataManager::Set(DREF_YokeHeading, yaw, aircraft);
DataManager::Set(DREF_ThrottleSet, thrArray, 8, aircraft);
DataManager::Set(DREF_ThrottleActual, thrArray, 8, aircraft);
if (aircraft == 0)
if (pitch < -999.5 || pitch > -997.5)
{
DataManager::Set("sim/flightmodel/engine/ENGN_thro_override", thrArray, 1);
DataManager::Set(DREF_YokePitch, pitch, aircraft);
}
if (roll < -999.5 || roll > -997.5)
{
DataManager::Set(DREF_YokeRoll, roll, aircraft);
}
if (yaw < -999.5 || yaw > -997.5)
{
DataManager::Set(DREF_YokeHeading, yaw, aircraft);
}
if (thr < -999.5 || thr > -997.5)
{
float thrArray[8];
for (int i = 0; i < 8; ++i)
{
thrArray[i] = thr;
}
DataManager::Set(DREF_ThrottleSet, thrArray, 8, aircraft);
DataManager::Set(DREF_ThrottleActual, thrArray, 8, aircraft);
if (aircraft == 0)
{
DataManager::Set("sim/flightmodel/engine/ENGN_thro_override", thrArray, 1);
}
}
if (gear != -1)
{