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
|
_G.cT,sbt,C,T,io = 0,{},coroutine,table,io -- currentTask,sandboxTable
|
||||||
function _G.spawn(n,f,e)
|
function _G.spawn(n,f,e)
|
||||||
tT[nP] = {}
|
tT[nP] = {}
|
||||||
sbt[nP] = {}
|
|
||||||
setmetatable(sbt[nP],{__index=_G})
|
|
||||||
_ENV = sbt[nP]
|
|
||||||
tT[nP].c = coroutine.create(f)
|
tT[nP].c = coroutine.create(f)
|
||||||
_ENV = rg
|
|
||||||
tT[nP].n = n
|
tT[nP].n = n
|
||||||
tT[nP].p = cT or -1
|
tT[nP].p = cT or -1
|
||||||
if tT[cT] then
|
if tT[cT] then
|
||||||
@ -44,7 +40,7 @@ do -- so local works
|
|||||||
else
|
else
|
||||||
cT=pid
|
cT=pid
|
||||||
for i = 1,tT[pid].ep, #eq do
|
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)
|
coroutine.resume(proc.c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -101,4 +97,9 @@ do -- so local works
|
|||||||
return tT[pid].n,tT[pid].p,tT[pid].u
|
return tT[pid].n,tT[pid].p,tT[pid].u
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function os.genenv()
|
||||||
|
local et = {}
|
||||||
|
setmetatable(et,{__index=_G})
|
||||||
|
return et
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user