Skip to content

Commit

Permalink
Merge pull request #2253 from ikemen-engine/fix
Browse files Browse the repository at this point in the history
fix: config.ini saving
  • Loading branch information
K4thos authored Jan 15, 2025
2 parents ddc35b3 + 0dcf37d commit b8172f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions external/script/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ local t_commonFilesOriginal = gameOption('Common')
function options.f_saveCfg(reload)
-- Restore the original content of the common files
local t_commonFiles = gameOption('Common')
for k, v in pairs(t_commonFilesOriginal) do
modifyGameOption('Common.' .. k, v)
for _, k in ipairs({'Air', 'Cmd', 'Const', 'States', 'Fx', 'Modules', 'Lua'}) do
modifyGameOption('Common.' .. k, t_commonFilesOriginal[k][k:lower()] or {})
end
-- Save the current configuration to 'config.ini'
saveGameOption(main.flags['-config'])
Expand All @@ -42,8 +42,8 @@ function options.f_saveCfg(reload)
os.exit()
end
-- Reapply modified common file arrays after saving
for k, v in pairs(t_commonFiles) do
modifyGameOption('Common.' .. k, v)
for _, k in ipairs({'Air', 'Cmd', 'Const', 'States', 'Fx', 'Modules', 'Lua'}) do
modifyGameOption('Common.' .. k, t_commonFiles[k][k:lower()] or {})
end
end

Expand Down

0 comments on commit b8172f8

Please sign in to comment.