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