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
|
||||
-- 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
|
||||
print("DEBUG: SensorData.Velocity.Raw is nil, skipping UpdateGlobalThrust")
|
||||
end
|
||||
@@ -748,7 +748,7 @@ function UpdateGlobalThrust()
|
||||
|
||||
-- angular thrust
|
||||
-- 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
|
||||
print("DEBUG: SensorData.Gimbal.AngularRates is nil, skipping UpdateGlobalThrust")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user