diff options
author | 2016-04-07 20:02:33 -0500 | |
---|---|---|
committer | 2016-04-07 20:02:33 -0500 | |
commit | ea484da9a8bf8f6e939cfd7cd85d3ff52fd76024 (patch) | |
tree | efcb577961f1184eb155a72f6523e840bb695972 /plugins/cheat/init.lua | |
parent | d88bdb6869f49548dfa4ddfd7a5dd43a4df594b2 (diff) |
plugins/cheat: create temp[0-9] in case xml script doesn't (nw)
Diffstat (limited to 'plugins/cheat/init.lua')
-rw-r--r-- | plugins/cheat/init.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 94542aaafae..fb15804aa93 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -158,18 +158,22 @@ function cheat.startplugin() script = load(script, cheat.desc .. name, "t", cheat.cheat_env) if not script then print("error loading cheat script: " .. cheat.desc) - cheat = nil + cheat = { desc = cheat.desc .. "error" } return end cheat.script[name] = script end + -- initialize temp[0-9] for backward compatbility reasons + for i = 0, 9 do + cheat.cheat_env["temp" .. i] = 0 + end if cheat.space then for name, space in pairs(cheat.space) do local cpu, mem cpu = manager:machine().devices[space.tag] if not cpu then print("error loading cheat script: " .. cheat.desc) - cheat = nil + cheat = { desc = cheat.desc .. "error" } return end if space.type then @@ -179,7 +183,7 @@ function cheat.startplugin() end if not mem then print("error loading cheat script: " .. cheat.desc) - cheat = nil + cheat = { desc = cheat.desc .. "error" } return end cheat.cheat_env[name] = mem |