diff options
author | 2022-03-23 20:27:30 +1100 | |
---|---|---|
committer | 2022-03-23 20:27:30 +1100 | |
commit | e6588480c477a8132676abbbb32bfc42287d8c6d (patch) | |
tree | b483f8b9e049a280f68ae7b0af9c57372676f5df /plugins/cheatfind/init.lua | |
parent | bb3f3e5abd7051ed371fe7fbdd0f49a56cc03f1f (diff) |
Lua engine improvements (#9453)
Made auto-boot script errors and plugin bootstrap errors fatal.
Run auto-boot scripts in a sandbox. Globals can be accessed, but not
set. The sandbox is cleared on hard reset, but not on soft reset.
Added (hopefully) useful to string metafunctions to device_t and
address space that show short names and tags.
Fixed issues in plugins that surface when strict type checking is
enabled, as this means numbers and nil are not automatically converted
to strings. Plugins should be tested with debug builds to check for
this.
Made save item read_block raise an error on invalid arguments rather
than returning an empty string, and made it use luaL_buffer directly
rather than using the helper wrapper.
Changed some more function bindings to use set_function to avoid issues
related to ThePhD/sol2#608, and got rid of some unnecessary lambda
captures.
Diffstat (limited to 'plugins/cheatfind/init.lua')
-rw-r--r-- | plugins/cheatfind/init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua index d565b31437f..96617e12fb6 100644 --- a/plugins/cheatfind/init.lua +++ b/plugins/cheatfind/init.lua @@ -351,7 +351,7 @@ function cheatfind.startplugin() for num, func in ipairs(menu) do local item, f = func() if item then - menu_list[#menu_list + 1] = item + table.insert(menu_list, item) menu_func[#menu_list] = f end end @@ -715,9 +715,9 @@ function cheatfind.startplugin() end local m if optable[opsel] == "ltv" or optable[opsel] == "gtv" or optable[opsel] == "eqv" or optable[opsel] == "nev" then - m = { _("Value"), value, "" } + m = { _("Value"), tostring(value), "" } else - m = { _("Difference"), value, "" } + m = { _("Difference"), tostring(value), "" } end local max = 100 -- max value? menu_lim(value, 0, max, m) @@ -792,7 +792,7 @@ function cheatfind.startplugin() end menu[#menu + 1] = function() return { "---", "", "off" }, nil end menu[#menu + 1] = function() - local m = { _("Match block"), matchsel, "" } + local m = { _("Match block"), tostring(matchsel), "" } menu_lim(matchsel, 0, #matches[#matches], m) if matchsel == 0 then m[2] = _("All") @@ -1017,7 +1017,7 @@ function cheatfind.startplugin() end if matches[#matches].count > 100 then menu[#menu + 1] = function() - local m = { _("Page"), matchpg, "on" } + local m = { _("Page"), tostring(matchpg), "on" } local max if matchsel == 0 then max = math.ceil(matches[#matches].count / 100) - 1 |