Fix ForcedAutorun being called two times in some cases

This commit is contained in:
EvilFactory
2022-10-03 13:12:59 -03:00
parent a3eff91c1a
commit 011ac43226

View File

@@ -125,11 +125,13 @@ ProcessPackages(
ProcessPackages(
ContentPackageManager.LocalPackages,
function(pkg, pkgPath)
table.insert(package.path, pkgPath .. LUA_MOD_REQUIRE_PATH)
local forcedAutorunPath = pkgPath .. LUA_MOD_FORCEDAUTORUN_PATH
if File.DirectoryExists(forcedAutorunPath) then
QueueForcedAutorun(forcedAutorunPath, pkgPath, pkg)
executedLocalPackages[pkg.Name] = true
if not executedLocalPackages[pkg.Name] then
table.insert(package.path, pkgPath .. LUA_MOD_REQUIRE_PATH)
local forcedAutorunPath = pkgPath .. LUA_MOD_FORCEDAUTORUN_PATH
if File.DirectoryExists(forcedAutorunPath) then
QueueForcedAutorun(forcedAutorunPath, pkgPath, pkg)
executedLocalPackages[pkg.Name] = true
end
end
end
)