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:
@@ -195,20 +195,33 @@ namespace XPC
|
|||||||
spdbrk = *((float*)(buffer + 27));
|
spdbrk = *((float*)(buffer + 27));
|
||||||
}
|
}
|
||||||
|
|
||||||
float thrArray[8];
|
|
||||||
for (int i = 0; i < 8; ++i)
|
|
||||||
{
|
|
||||||
thrArray[i] = thr;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataManager::Set(DREF_YokePitch, pitch, aircraft);
|
if (pitch < -999.5 || pitch > -997.5)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
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)
|
if (gear != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user