Fixed inconsistent moduleName

This commit is contained in:
Cooldude2606
2018-12-30 22:06:49 +00:00
parent cd4b06a996
commit 97b00a3a1b
2 changed files with 3 additions and 3 deletions

View File

@@ -281,7 +281,7 @@ function Server._thread:create(obj)
obj._env._ENV = nil -- provents infinte recusion
-- removes any modules from the _env to save space in global (less time to serizle)
obj._env._modules = {}
for name,value in pairs(obj._env) do if is_type(value,'table') and value._module_name and loaded_modules[value._module_name] == value then obj._env._modules[name] = value._module_name obj._env[name] = nil end end
for name,value in pairs(obj._env) do if is_type(value,'table') and value._moduleName and loaded_modules[value._moduleName] == value then obj._env._modules[name] = value._moduleName obj._env[name] = nil end end
setmetatable(obj._env,_env_metatable)
local name = obj.name or 'Anon'
verbose('Created new thread: '..name..' ('..obj.uuid..')')

View File

@@ -5,9 +5,9 @@ local Game = { --luacheck: allow defined top
VALID_FILTER = function(v)
return v and v.valid
end,
_protect = function(module_name)
_protect = function(moduleName)
return {
__newindex = function() error("Attempt to mutatate read-only "..module_name.." Module") end,
__newindex = function() error("Attempt to mutatate read-only "..moduleName.." Module") end,
__metatable = true
}
end,