summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2019-01-26 22:16:31 -0600
committer cracyc <cracyc@users.noreply.github.com>2019-01-26 22:18:14 -0600
commit74ff29e22802843a57e94ad6b56a51098caf1fc8 (patch)
treee7f64f69c82bb145847d4aafba8408cc5e4c1276
parent3d2b6d0d9bc07b1278c3366bb2936edf818c9d69 (diff)
plugins/cheatfind: fix address step when shift is negative (nw)
-rw-r--r--plugins/cheatfind/init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index 86fcf04ca49..5dcdd5a18e3 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -106,6 +106,9 @@ function cheatfind.startplugin()
if not step or step <= 0 then
step = 1
end
+ if (olddata.shift < 0) and (step < (1 << -olddata.shift)) then
+ step = 1 << -olddata.shift;
+ end
local cfoper = {
lt = function(a, b, val) return (a < b and val == 0) or (val > 0 and (a + val) == b) end,
@@ -192,7 +195,7 @@ function cheatfind.startplugin()
oldval = old,
newval = new,
bitmask = bitmask }
- ref[ret[#ret].addr] = #ret
+ ref[addr] = #ret
end
end
end
@@ -829,7 +832,7 @@ function cheatfind.startplugin()
local m = { _("Page"), matchpg, 0 }
local max
if matchsel == 0 then
- max = math.ceil(matches[#matches].count / 100)
+ max = math.ceil(matches[#matches].count / 100) - 1
else
max = #matches[#matches][matchsel]
end