mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -04:00
Avoid potential assertion error.
This commit is contained in:
parent
e4ebcbb6a4
commit
fc16ceb935
@ -115,12 +115,11 @@ local function execute(env, command, ...)
|
||||
end
|
||||
table.insert(args, 1, true)
|
||||
args.n = #args
|
||||
local thread, reason = process.load(shell.resolve(program, "lua"), env, nil, command)
|
||||
local thread, reason = process.load(program, env, nil, command)
|
||||
if not thread then
|
||||
return false, reason
|
||||
else
|
||||
os.setenv ( '_', shell.resolve (program, "lua") )
|
||||
end
|
||||
os.setenv("_", program)
|
||||
local result = nil
|
||||
-- Emulate CC behavior by making yields a filtered event.pull()
|
||||
while args[1] and coroutine.status(thread) ~= "dead" do
|
||||
|
@ -721,6 +721,9 @@ class Machine(val owner: Owner, constructor: Constructor[_ <: Architecture]) ext
|
||||
|
||||
private def switchTo(value: Machine.State.Value) = {
|
||||
val result = state.pop()
|
||||
if (value == Machine.State.Stopping || value == Machine.State.Restarting) {
|
||||
state.clear()
|
||||
}
|
||||
state.push(value)
|
||||
if (value == Machine.State.Yielded || value == Machine.State.SynchronizedReturn) {
|
||||
remainIdle = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user