Fixed index bug for _G modules

This commit is contained in:
Cooldude2606
2018-05-29 22:15:22 +01:00
parent 98481696f0
commit 9b80e8d8fe

View File

@@ -217,7 +217,7 @@ Manager.loadModules = setmetatable({},
else for key,value in pairs(table.remove(module,1)) do tbl[module_name][key] = value end end
end
-- if there is a module by this name in _G ex table then it will be indexed to the new module
if rawget(_G,module_name) then setmetatable(rawget(_G,module_name),{__index=tbl[module_name]}) end
if rawget(_G,module_name) and type(tbl[module_name]) == 'table' then setmetatable(rawget(_G,module_name),{__index=tbl[module_name]}) end
else
Manager.verbose('Failed load: "'..module_name..'"; Location: '..location..' ('..module..')','errorCaught')
end