From e13ae84aaebbf332233019581d651c2e124b3d56 Mon Sep 17 00:00:00 2001 From: templeofshadow Date: Mon, 29 Jun 2026 14:02:58 -0500 Subject: [PATCH] hopefully fix nil reference error related to propeller transmissions --- main.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.lua b/main.lua index bd6ccb9..82c318f 100644 --- a/main.lua +++ b/main.lua @@ -255,7 +255,7 @@ function PropellerInit() Thrusters[peripheral.getName(pv)] = { type = "rotator", thruster = pv, - transmission = tv, + transmission = peripheral.wrap(tv), --[[ NOTE: affectVectors will have values depending on how the thruster's @@ -289,7 +289,7 @@ function PropellerInit() Thrusters[peripheral.getName(pv)].type = "rotator" end Thrusters[peripheral.getName(pv)].thruster = pv - Thrusters[peripheral.getName(pv)].transmission = tv + Thrusters[peripheral.getName(pv)].transmission = peripheral.wrap(tv) if Thrusters[peripheral.getName(pv)].affectVectors == nil then Thrusters[peripheral.getName(pv)].affectVectors = {} end @@ -455,7 +455,7 @@ local function partiallyUpdateThrusters(thrusterList) local transmissions = peripheral.find(tt) for _, t in ipairs(transmissions) do if tv.getSubnetworkAnchorId() == t.getSelfId() then - thisThruster.transmission = t + thisThruster.transmission = peripheral.getName(t) end end end @@ -659,7 +659,7 @@ function SetThrusterPower(thruster, power) if thruster.type == "rotator" then thruster.power = power local actualPower = 0 - if peripheral.getType(thruster.transmission) == "Create_RotationSpeedController" then + if peripheral.getType(peripheral.wrap(thruster.transmission)) == "Create_RotationSpeedController" then if (math.ceil(power*256) - power*256 <= 0.5) then actualPower = math.ceil(power*256) end @@ -669,7 +669,7 @@ function SetThrusterPower(thruster, power) thruster.transmission.setTargetSpeed(actualPower) end - if peripheral.getType(thruster.transmission) == "analog_transmission" then + if peripheral.getType(peripheral.wrap(thruster.transmission)) == "analog_transmission" then if (math.ceil(power*15) - power*15) <= 0.5 then actualPower = math.ceil(power*15) end @@ -684,7 +684,7 @@ function SetThrusterPower(thruster, power) actualPower = actualPower - 1 end - thruster.transmission.setSignal(actualPower) + peripheral.wrap(thruster.transmission).setSignal(actualPower) end end