add nil checking for thruster init functions
This commit is contained in:
15
main.lua
15
main.lua
@@ -241,11 +241,17 @@ function PropellerInit()
|
||||
local propellers = {}
|
||||
|
||||
for _, v in ipairs(TransmissionTypes) do
|
||||
table.insert(transmissions, peripheral.find(v))
|
||||
local vlist = peripheral.find(v)
|
||||
if vlist ~= nil and vlist[1] ~= nil then
|
||||
table.insert(transmissions, vlist)
|
||||
end
|
||||
end
|
||||
|
||||
for _, v in ipairs(PropellerTypes) do
|
||||
table.insert(propellers, peripheral.find(v))
|
||||
local vlist = peripheral.find(v)
|
||||
if vlist ~= nil and vlist[1] ~= nil then
|
||||
table.insert(propellers, vlist)
|
||||
end
|
||||
end
|
||||
|
||||
for pi, pv in ipairs(propellers) do
|
||||
@@ -306,7 +312,10 @@ function ThrusterInit()
|
||||
local thrusters = {}
|
||||
|
||||
for _, v in ipairs(ThrusterTypes) do
|
||||
table.insert(thrusters, peripheral.find(v))
|
||||
local vlist = peripheral.find(v)
|
||||
if vlist ~= nil and vlist[1] ~= nil then
|
||||
table.insert(thrusters, vlist)
|
||||
end
|
||||
end
|
||||
|
||||
for ti, tv in ipairs(thrusters) do
|
||||
|
||||
Reference in New Issue
Block a user