attempt a different approach at finding transmissions
This commit is contained in:
6
main.lua
6
main.lua
@@ -257,7 +257,7 @@ function PropellerInit()
|
|||||||
for pi, pv in ipairs(propellers) do
|
for pi, pv in ipairs(propellers) do
|
||||||
if Thrusters[peripheral.getName(pv)] == nil then
|
if Thrusters[peripheral.getName(pv)] == nil then
|
||||||
for _, tv in pairs(transmissions) do
|
for _, tv in pairs(transmissions) do
|
||||||
if pv.getSubnetworkAnchorId() == tv.getSelfId() then
|
if pv.getSourceId() == tv.getSelfId() then
|
||||||
if Thrusters[peripheral.getName(pv)] == nil then
|
if Thrusters[peripheral.getName(pv)] == nil then
|
||||||
Thrusters[peripheral.getName(pv)] = {
|
Thrusters[peripheral.getName(pv)] = {
|
||||||
type = "rotator",
|
type = "rotator",
|
||||||
@@ -383,7 +383,7 @@ local function populateThrusterValues()
|
|||||||
end
|
end
|
||||||
if thruster.type == "rotator" and thruster.transmission == nil then
|
if thruster.type == "rotator" and thruster.transmission == nil then
|
||||||
if Config.Debug then print("DEBUG: Thruster "..thruster.name.." does not have an associated transmission.") end
|
if Config.Debug then print("DEBUG: Thruster "..thruster.name.." does not have an associated transmission.") end
|
||||||
local subnetworkId = peripheral.wrap(thruster.name).getSubnetworkAnchorId()
|
local subnetworkId = peripheral.wrap(thruster.name).getSourceId()
|
||||||
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
|
if transmissions ~= nil and transmissions[1] ~= nil then
|
||||||
@@ -524,7 +524,7 @@ local function partiallyUpdateThrusters(thrusterList)
|
|||||||
for _, tt in ipairs(TransmissionTypes) do
|
for _, tt in ipairs(TransmissionTypes) do
|
||||||
local transmissions = peripheral.find(tt)
|
local transmissions = peripheral.find(tt)
|
||||||
for _, t in ipairs(transmissions) do
|
for _, t in ipairs(transmissions) do
|
||||||
if tv.getSubnetworkAnchorId() == t.getSelfId() then
|
if tv.getSourceId() == t.getSelfId() then
|
||||||
thisThruster.transmission = peripheral.getName(t)
|
thisThruster.transmission = peripheral.getName(t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user