turtle: fix pausing
This commit is contained in:
parent
5f5dcf7195
commit
78c5bc868d
@ -327,7 +327,7 @@ function turtle.pause_symbolic(name)
|
|||||||
local dead = turtle.get_symbolic(name)
|
local dead = turtle.get_symbolic(name)
|
||||||
|
|
||||||
for i, v in ipairs(dead) do
|
for i, v in ipairs(dead) do
|
||||||
turtle.states[v].paused = true
|
turtle.states[v].state.paused = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ function turtle.resume_symbolic(name)
|
|||||||
local dead = turtle.get_symbolic(name)
|
local dead = turtle.get_symbolic(name)
|
||||||
|
|
||||||
for i, v in ipairs(dead) do
|
for i, v in ipairs(dead) do
|
||||||
turtle.states[v].paused = nil
|
turtle.states[v].state.paused = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ tlang.builtins["forever"] = function(state)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if state.locals[slen].loop_code == nil then
|
if state.locals[slen].loop_code == nil then
|
||||||
local tos = statepop(state)
|
local tos = tlang.pop_raw(state)
|
||||||
|
|
||||||
if tos.type == "code" then
|
if tos.type == "code" then
|
||||||
state.locals[slen].loop_code = tos
|
state.locals[slen].loop_code = tos
|
||||||
@ -646,7 +646,7 @@ end
|
|||||||
-- false - finished
|
-- false - finished
|
||||||
-- string - error
|
-- string - error
|
||||||
function tlang.step(state)
|
function tlang.step(state)
|
||||||
if state.paused or state.wait_target and os.clock() < state.wait_target then
|
if state.paused or (state.wait_target and os.clock() < state.wait_target) then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user