diff --git a/Barotrauma/BarotraumaShared/Lua/ModLoader.lua b/Barotrauma/BarotraumaShared/Lua/ModLoader.lua index 8dffa9d27..cb8a3f385 100644 --- a/Barotrauma/BarotraumaShared/Lua/ModLoader.lua +++ b/Barotrauma/BarotraumaShared/Lua/ModLoader.lua @@ -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 )