diff --git a/modules/ExpGamingCore/Server/control.lua b/modules/ExpGamingCore/Server/control.lua index 0d3f4b32..2344ce88 100644 --- a/modules/ExpGamingCore/Server/control.lua +++ b/modules/ExpGamingCore/Server/control.lua @@ -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..')') diff --git a/modules/FactorioStdLib/Game/control.lua b/modules/FactorioStdLib/Game/control.lua index 219b88f7..b7608965 100644 --- a/modules/FactorioStdLib/Game/control.lua +++ b/modules/FactorioStdLib/Game/control.lua @@ -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,