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)
|
||||
|
||||
for i, v in ipairs(dead) do
|
||||
turtle.states[v].paused = true
|
||||
turtle.states[v].state.paused = true
|
||||
end
|
||||
end
|
||||
|
||||
@ -335,7 +335,7 @@ function turtle.resume_symbolic(name)
|
||||
local dead = turtle.get_symbolic(name)
|
||||
|
||||
for i, v in ipairs(dead) do
|
||||
turtle.states[v].paused = nil
|
||||
turtle.states[v].state.paused = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -467,7 +467,7 @@ tlang.builtins["forever"] = function(state)
|
||||
end
|
||||
|
||||
if state.locals[slen].loop_code == nil then
|
||||
local tos = statepop(state)
|
||||
local tos = tlang.pop_raw(state)
|
||||
|
||||
if tos.type == "code" then
|
||||
state.locals[slen].loop_code = tos
|
||||
@ -646,7 +646,7 @@ end
|
||||
-- false - finished
|
||||
-- string - error
|
||||
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
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user