turtle/tlang: add state pausing

wsc-master-rebase
cron 2020-11-08 17:35:55 +00:00 committed by Schmappie Eldress
parent b7dcc4299d
commit 78d66a7125
1 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ end
builtins = {},
code_stack = {},
wait_target = float,
paused = f/t,
nextpop = f/t
}
--]]
@ -632,7 +633,7 @@ end
-- false - finished
-- string - error
function tlang.step(state)
if 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