added nil check for transmission list in populateThrusterValues
This commit is contained in:
2
main.lua
2
main.lua
@@ -426,6 +426,7 @@ local function populateThrusterValues()
|
|||||||
local subnetworkId = peripheral.wrap(thruster.name).getSubnetworkAnchorId()
|
local subnetworkId = peripheral.wrap(thruster.name).getSubnetworkAnchorId()
|
||||||
for _, transmissionType in ipairs(TransmissionTypes) do
|
for _, transmissionType in ipairs(TransmissionTypes) do
|
||||||
local transmissions = peripheral.find(transmissionType)
|
local transmissions = peripheral.find(transmissionType)
|
||||||
|
if transmissions ~= nil and transmissions[1] ~= nil then
|
||||||
for _, transmission in ipairs(transmissions) do
|
for _, transmission in ipairs(transmissions) do
|
||||||
if transmission.getSelfId() == subnetworkId then
|
if transmission.getSelfId() == subnetworkId then
|
||||||
thruster.transmission = peripheral.getName(transmission)
|
thruster.transmission = peripheral.getName(transmission)
|
||||||
@@ -433,6 +434,7 @@ local function populateThrusterValues()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if thruster.power == nil then
|
if thruster.power == nil then
|
||||||
if thruster.type == "thruster" then
|
if thruster.type == "thruster" then
|
||||||
thruster.power = thruster.thruster.getPower()
|
thruster.power = thruster.thruster.getPower()
|
||||||
|
|||||||
Reference in New Issue
Block a user