diff options
Diffstat (limited to 'plugins/cheat/init.lua')
| -rw-r--r-- | plugins/cheat/init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 4755d8106cd..dedbea9b2f9 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -476,9 +476,11 @@ function cheat.startplugin() start_time = emu.time() cheats = load_cheats() local json = require("json") - local file = io.open(manager:machine():options().entries.cheatpath:value() .. "/output.json", "w") - file:write(json.stringify(cheats, {indent = true})) - file:close() + local file = io.open(manager:machine():options().entries.cheatpath:value():match("([^;]+)") .. "/output.json", "w") + if file then + file:write(json.stringify(cheats, {indent = true})) + file:close() + end for num, cheat in pairs(cheats) do parse_cheat(cheat) end |
