use Game.GameSettings instead of GetEnabledContentPackages

This commit is contained in:
Evil Factory
2022-03-05 21:32:31 -03:00
parent abf329dd21
commit 9c0bcaa44f

View File

@@ -33,7 +33,7 @@ else
print("LUA LOADER: Only enabled mods will be executed. Lua/LuaSetup.lua")
end
local enabledPackages = Game.GetEnabledContentPackages()
local enabledPackages = Game.GameSettings.AllEnabledPackages
local function endsWith(str, suffix)
return str:sub(-string.len(suffix)) == suffix
@@ -55,14 +55,16 @@ if SERVER then
if not runDisabledMods then
for _, package in pairs(enabledPackages) do
local d = package.path:gsub("\\", "/")
d = d:gsub("/filelist.xml", "")
for _, package in enabledPackages do
if package then
local d = package.path:gsub("\\", "/")
d = d:gsub("/filelist.xml", "")
table.insert(modulePaths, (d .. "/Lua/?.lua"))
table.insert(modulePaths, (d .. "/Lua/?.lua"))
if File.DirectoryExists(d .. "/Lua/Autorun") then
runFolder(d .. "/Lua/Autorun")
if File.DirectoryExists(d .. "/Lua/Autorun") then
runFolder(d .. "/Lua/Autorun")
end
end
end