refine nil check in last commit
This commit is contained in:
4
main.lua
4
main.lua
@@ -711,7 +711,7 @@ function UpdateGlobalThrust()
|
|||||||
|
|
||||||
-- lateral thrust
|
-- lateral thrust
|
||||||
-- verify that SensorData.Velocity.Raw is not nil
|
-- verify that SensorData.Velocity.Raw is not nil
|
||||||
if SensorData.Velocity.Raw == nil then
|
if SensorData.Velocity == nil or SensorData.Velocity.Raw == nil then
|
||||||
if Config.Debug then
|
if Config.Debug then
|
||||||
print("DEBUG: SensorData.Velocity.Raw is nil, skipping UpdateGlobalThrust")
|
print("DEBUG: SensorData.Velocity.Raw is nil, skipping UpdateGlobalThrust")
|
||||||
end
|
end
|
||||||
@@ -748,7 +748,7 @@ function UpdateGlobalThrust()
|
|||||||
|
|
||||||
-- angular thrust
|
-- angular thrust
|
||||||
-- verify that SensorData.Gimbal.AngularRates is not nil
|
-- verify that SensorData.Gimbal.AngularRates is not nil
|
||||||
if SensorData.Gimbal.AngularRates == nil then
|
if SensorData.Gimbal == nil or SensorData.Gimbal.AngularRates == nil then
|
||||||
if Config.Debug then
|
if Config.Debug then
|
||||||
print("DEBUG: SensorData.Gimbal.AngularRates is nil, skipping UpdateGlobalThrust")
|
print("DEBUG: SensorData.Gimbal.AngularRates is nil, skipping UpdateGlobalThrust")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user