add nil checking for thruster init functions

This commit is contained in:
2026-06-29 19:51:53 -05:00
parent ab8d65f477
commit aff1a45a58

View File

@@ -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