use Game.GameSettings instead of GetEnabledContentPackages
This commit is contained in:
@@ -33,7 +33,7 @@ else
|
|||||||
print("LUA LOADER: Only enabled mods will be executed. Lua/LuaSetup.lua")
|
print("LUA LOADER: Only enabled mods will be executed. Lua/LuaSetup.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
local enabledPackages = Game.GetEnabledContentPackages()
|
local enabledPackages = Game.GameSettings.AllEnabledPackages
|
||||||
|
|
||||||
local function endsWith(str, suffix)
|
local function endsWith(str, suffix)
|
||||||
return str:sub(-string.len(suffix)) == suffix
|
return str:sub(-string.len(suffix)) == suffix
|
||||||
@@ -55,14 +55,16 @@ if SERVER then
|
|||||||
|
|
||||||
if not runDisabledMods then
|
if not runDisabledMods then
|
||||||
|
|
||||||
for _, package in pairs(enabledPackages) do
|
for _, package in enabledPackages do
|
||||||
local d = package.path:gsub("\\", "/")
|
if package then
|
||||||
d = d:gsub("/filelist.xml", "")
|
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
|
if File.DirectoryExists(d .. "/Lua/Autorun") then
|
||||||
runFolder(d .. "/Lua/Autorun")
|
runFolder(d .. "/Lua/Autorun")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user