mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
plugins/cheat: fix XML cheat loading when emulation is launched with an image option specified (e.g. mame nes -cart smb) or by loading directly one part of the software (e.g. mame a600 amigaocs_flop:lslarry2:flop1)
This commit is contained in:
parent
1bc0dcbf46
commit
bcfd7c64b0
@ -95,18 +95,15 @@ function cheat.startplugin()
|
||||
local filename = emu.romname()
|
||||
local newcheats = {}
|
||||
local file = emu.file(manager.machine.options.entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") , 1)
|
||||
if emu.softname() ~= "" then
|
||||
if emu.softname():find(":") then
|
||||
filename = emu.softname():gsub(":", "/")
|
||||
else
|
||||
for name, image in pairs(manager.machine.images) do
|
||||
if image.exists and image.software_list_name ~= "" then
|
||||
filename = image.software_list_name .. "/" .. emu.softname()
|
||||
end
|
||||
end
|
||||
|
||||
for name, image in pairs(manager.machine.images) do
|
||||
if image.exists and image.software_list_name ~= "" then
|
||||
filename = image.software_list_name .. "/" .. image.filename
|
||||
end
|
||||
end
|
||||
|
||||
cheatname = filename
|
||||
print(cheatname)
|
||||
local function add(addcheats)
|
||||
if not next(newcheats) then
|
||||
newcheats = addcheats
|
||||
|
Loading…
Reference in New Issue
Block a user