added os.genenv, made the MultICE ev compat work properly.
This commit is contained in:
parent
22839cd27c
commit
0b624a6245
@ -12,11 +12,7 @@ do -- so local works
|
||||
_G.cT,sbt,C,T,io = 0,{},coroutine,table,io -- currentTask,sandboxTable
|
||||
function _G.spawn(n,f,e)
|
||||
tT[nP] = {}
|
||||
sbt[nP] = {}
|
||||
setmetatable(sbt[nP],{__index=_G})
|
||||
_ENV = sbt[nP]
|
||||
tT[nP].c = coroutine.create(f)
|
||||
_ENV = rg
|
||||
tT[nP].n = n
|
||||
tT[nP].p = cT or -1
|
||||
if tT[cT] then
|
||||
@ -44,7 +40,7 @@ do -- so local works
|
||||
else
|
||||
cT=pid
|
||||
for i = 1,tT[pid].ep, #eq do
|
||||
sbt[pid].ev = eq[#eq] -- make an ev for MultICE compat
|
||||
_G.ev = eq[#eq] -- make an ev for MultICE compat
|
||||
coroutine.resume(proc.c)
|
||||
end
|
||||
end
|
||||
@ -101,4 +97,9 @@ do -- so local works
|
||||
return tT[pid].n,tT[pid].p,tT[pid].u
|
||||
end
|
||||
end
|
||||
function os.genenv()
|
||||
local et = {}
|
||||
setmetatable(et,{__index=_G})
|
||||
return et
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user