hopefully fix "too long without yielding" error for throttles
This commit is contained in:
20
main.lua
20
main.lua
@@ -176,17 +176,17 @@ function ThrottleInit()
|
|||||||
|
|
||||||
local initialStates = getRelayStates()
|
local initialStates = getRelayStates()
|
||||||
|
|
||||||
while true do
|
os.pullEvent("redstone")
|
||||||
local currentStates = getRelayStates()
|
|
||||||
|
|
||||||
for pname, currentState in pairs(currentStates) do
|
local currentStates = getRelayStates()
|
||||||
local initialState = initialStates[pname]
|
|
||||||
for k, v in pairs(currentState) do
|
for pname, currentState in pairs(currentStates) do
|
||||||
if initialState[k] ~= v then
|
local initialState = initialStates[pname]
|
||||||
Throttles[throttleType].name = pname
|
for k, v in pairs(currentState) do
|
||||||
Throttles[throttleType].side = k
|
if initialState[k] ~= v then
|
||||||
return
|
Throttles[throttleType].name = pname
|
||||||
end
|
Throttles[throttleType].side = k
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user