aboutsummaryrefslogtreecommitdiff
path: root/gamemode/nrequire.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/nrequire.lua')
-rw-r--r--gamemode/nrequire.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/gamemode/nrequire.lua b/gamemode/nrequire.lua
index f25cbb7..14c2248 100644
--- a/gamemode/nrequire.lua
+++ b/gamemode/nrequire.lua
@@ -152,30 +152,35 @@ function nrequire(req)
end
--Override print so it's easy to see what file is printing what
- local tab_rep = {}
- for k = 1, #pathstack do tab_rep[k] = "\t" end
+ --local tab_rep = {}
+ --for k = 1, #pathstack do tab_rep[k] = "\t" end
--print(string.format("%sIncluding %q",table.concat(tab_rep),tpath))
- local oldprint = print
- print = function(...) oldprint(" ",unpack({...})) end
+ --local oldprint = print
+ --print = function(...) oldprint(" ",unpack({...})) end
--Deal with bookkeeping dealing with circular dependancies, and include
pathstack[#pathstack + 1] = tpath
+ reqtbl[tpath] = include(tpath)
+ --[[
co = coroutine.create(function()
reqtbl[tpath] = include(tpath)
--print("Finished ", tpath)
end)
coroutines[#coroutines + 1] = co
coroutine.resume(co)
+ ]]
pathstack[#pathstack] = nil
+ --[[
--Try to resume everyone else waiting on something
for k,v in pairs(coroutines) do
--V will be nil when the coroutine finishes, which removes it from the list, nifty.
coroutine.resume(v)
end
+ ]]
--Undo the crazy print
- print = oldprint
+ --print = oldprint
--print(string.format("%sIncluded %q",table.concat(tab_rep),tpath))
return reqtbl[tpath]
end