replace
function SaveToFileCmdOnOffValueEx(nID)
if nID == 0 then
saveFile = io.open("SaveData\\OptionInfo.lua", "w")
else
saveFile = io.open("data\\OptionInfo.lua", "w")
end
if saveFile ~= nil then
for k, v in pairs(CmdOnOffOderList) do
local value = c_GetCmdOnOffValue(v)
if value ~= -1 then
saveFile:write(string.format("CmdOnOffList[\"%s\"] = %d\n", v, value))
end
end
saveFile:write("\n")
io.close(saveFile)
end
end
with
function SaveToFileCmdOnOffValueEx(nID)
if nID == 0 then
saveFile = io.open("SaveData\\OptionInfo.lua", "w")
else
saveFile = io.open("data\\OptionInfo.lua", "w")
end
if saveFile ~= nil then
saveFile:write("CmdOnOffList = {}\n")
saveFile:write("OptionInfoList = {}\n")
for k, v in pairs(CmdOnOffOderList) do
local value = c_GetCmdOnOffValue(v)
if value ~= -1 then
saveFile:write(string.format("CmdOnOffList[\"%s\"] = %d\n", v, value))
end
end
saveFile:write("\n")
io.close(saveFile)
end
end