summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-04-30 10:48:10 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-04-30 10:48:10 -0500
commit4b6237fbfd79bca6e329193225578ca5367750ed (patch)
treebf09924e278dbd22238248ca44dee66ae2bd706f /plugins
parent9727a393f11fe3ac5a8f8234dcb671db533f2720 (diff)
plugins/cheat: handle multiple cheat paths and missing dir in write back (nw)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheat/init.lua8
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