From aff1a45a58fd431ecad2b53bf732be372a7a302f Mon Sep 17 00:00:00 2001 From: templeofshadow Date: Mon, 29 Jun 2026 19:51:53 -0500 Subject: [PATCH] add nil checking for thruster init functions --- main.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/main.lua b/main.lua index 2331929..c378f63 100644 --- a/main.lua +++ b/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