diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-11-17 00:08:55 -0500 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-11-17 00:08:55 -0500 |
| commit | 0a490d7d811c682a8d0f5a74840583028f13822a (patch) | |
| tree | 27974734c1e21d8b5899641b7fafd0e4de5b2411 /gamemode/core | |
| parent | 2b9a21d0b05c72cb01fd8fb55dc37f9a6fbca48b (diff) | |
| download | artery-0a490d7d811c682a8d0f5a74840583028f13822a.tar.gz artery-0a490d7d811c682a8d0f5a74840583028f13822a.tar.bz2 artery-0a490d7d811c682a8d0f5a74840583028f13822a.zip | |
Various updates
Fixed a few problems with dependencies
Diffstat (limited to 'gamemode/core')
| -rw-r--r-- | gamemode/core/dataloader/cl_loadglobals.lua | 21 | ||||
| -rw-r--r-- | gamemode/core/inventory/cl_invtracker.lua | 1 |
2 files changed, 14 insertions, 8 deletions
diff --git a/gamemode/core/dataloader/cl_loadglobals.lua b/gamemode/core/dataloader/cl_loadglobals.lua index d286f36..c4837c8 100644 --- a/gamemode/core/dataloader/cl_loadglobals.lua +++ b/gamemode/core/dataloader/cl_loadglobals.lua @@ -1,4 +1,15 @@ local log = nrequire("log.lua") + +local function run_csfile(txt,name) + assert(#txt > 0, "File was size 0 on: " .. name) + local ptr = CompileString(txt,name,false) + if type(ptr) == "function" then + ptr() + else + log.error(ptr) + end +end + net.Receive("artery_respondfile",function() local filename = net.ReadString() local filetext = net.ReadString() @@ -6,7 +17,7 @@ net.Receive("artery_respondfile",function() file.CreateDir("artery/client/files/" .. dirname) assert(#filetext > 0, "Retreived a size 0 file: " .. filename) file.Write("artery/client/files/" .. filename,filetext) - CompileString(filetext,filename)() + run_csfile(filetext,filename) end) net.Receive("artery_loadfile",function() @@ -26,12 +37,6 @@ net.Receive("artery_loadfile",function() net.WriteString(filename) net.SendToServer() else - assert(#cache > 0, "File was size 0 on: " .. filename) - local err = CompileString(cache,filename,false) - if type(err) == "function" then - err() - else - log.error(err) - end + run_csfile(cache,filename) end end) diff --git a/gamemode/core/inventory/cl_invtracker.lua b/gamemode/core/inventory/cl_invtracker.lua index 14cbfbe..fdf5be3 100644 --- a/gamemode/core/inventory/cl_invtracker.lua +++ b/gamemode/core/inventory/cl_invtracker.lua @@ -3,6 +3,7 @@ ]] local inv = nrequire("inventory/inventory.lua") local itm = nrequire("item.lua") +nrequire("cl_loadglobals.lua") --local state = nrequire("cl_state.lua") local q = {} |
