add nil check to thruster index checking
This commit is contained in:
10
main.lua
10
main.lua
@@ -302,11 +302,17 @@ local function checkIfThrusterIsIndexed()
|
|||||||
local unindexedThrusters = {}
|
local unindexedThrusters = {}
|
||||||
|
|
||||||
for _, v in ipairs(ThrusterTypes) do
|
for _, v in ipairs(ThrusterTypes) do
|
||||||
table.insert(thrusters, peripheral.find(v))
|
local thrustersList = peripheral.find(v)
|
||||||
|
if thrustersList then
|
||||||
|
table.insert(thrusters, peripheral.find(v))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, v in ipairs(PropellerTypes) do
|
for _, v in ipairs(PropellerTypes) do
|
||||||
table.insert(thrusters, peripheral.find(v))
|
local thrustersList = peripheral.find(v)
|
||||||
|
if thrustersList then
|
||||||
|
table.insert(thrusters, peripheral.find(v))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, v in ipairs(thrusters) do
|
for _, v in ipairs(thrusters) do
|
||||||
|
|||||||
Reference in New Issue
Block a user