mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
plugins/cheat: handle multiple cheat paths and missing dir in write back (nw)
This commit is contained in:
parent
9727a393f1
commit
4b6237fbfd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user