add nil check for rotator thrusters with nil transmissions

This commit is contained in:
2026-06-29 14:12:07 -05:00
parent dd4bc11c43
commit 9c22f72d4e

View File

@@ -663,6 +663,11 @@ function SetThrusterPower(thruster, power)
if thruster.type == "rotator" then
thruster.power = power
local actualPower = 0
if thruster.transmission == nil then
print("ERROR: SetThrusterPower called with nil transmission for rotator thruster.")
print("Thruster: "..thruster.name)
return
end
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)