Skip to content

Commit

Permalink
Merge pull request #625 from robertthepie/FixArchiveAlreadyLoaded
Browse files Browse the repository at this point in the history
Fix Archive Already Loaded
  • Loading branch information
AntlerForce authored Apr 3, 2024
2 parents 1b8e8b1 + ec5e2fe commit e89f377
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion LuaMenu/widgets/gui_modoptions_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,20 @@ function ModoptionsPanel.LoadModoptions(gameName, newBattleLobby)
return VFS.Include("modoptions.lua", nil, VFS.ZIP)
end

modoptions = VFS.UseArchive(gameName, LoadModOptions)
do
local alreadyLoaded = false
for _, archive in pairs(VFS.GetLoadedArchives()) do
if archive == gameName then
alreadyLoaded = true
break
end
end
if alreadyLoaded then
modoptions = VFS.Include("modoptions.lua", nil, VFS.ZIP)
else
modoptions = VFS.UseArchive(gameName, LoadModOptions)
end
end

modoptionDefaults = {}
if not modoptions then
Expand Down

0 comments on commit e89f377

Please sign in to comment.