removed debug statements from previous commit and (hopefully) fixed the array not empty check, since the check was designed for tables and not arrays
This commit is contained in:
7
main.lua
7
main.lua
@@ -487,16 +487,11 @@ end
|
|||||||
|
|
||||||
function PollVelocity()
|
function PollVelocity()
|
||||||
local velSensors = { peripheral.find("velocity_sensor") }
|
local velSensors = { peripheral.find("velocity_sensor") }
|
||||||
if (Config.Debug) then
|
|
||||||
print("DEBUG: Found "..#velSensors.." velocity sensors.")
|
|
||||||
print("DEBUG: Velocity sensors: "..tableToString(velSensors))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Velocity Sensors
|
-- Velocity Sensors
|
||||||
VelocityVectors = {}
|
VelocityVectors = {}
|
||||||
|
|
||||||
local next = next
|
if velSensors[0] == nil then -- verify array is not empty
|
||||||
if next(velSensors) == nil then -- verify table is not empty
|
|
||||||
|
|
||||||
SensorData.Velocity = {}
|
SensorData.Velocity = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user