diff options
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 |