summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2020-09-13 19:13:38 -0500
committer cracyc <cracyc@users.noreply.github.com>2020-09-13 19:13:38 -0500
commit692ff2c06f11a4cbb237595caeddfdfc0c5ed96b (patch)
tree966ebfb41ae17ad8df17f7f0e09934a527e96df2 /plugins
parent35bfe62b592457df22bd0c027173971aaa5b04a3 (diff)
plugin/cheat: subtract min before dividing
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheat/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index 418489f9525..2293e3c0605 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -569,7 +569,7 @@ function cheat.startplugin()
end
cheat.set_index = set_index;
cheat.set_value = function(cheat, value)
- local idx = (value / cheat.parameter.step) + 1
+ local idx = ((value - cheat.parameter.min) / cheat.parameter.step) + 1
local chg = false
if math.integer(idx) == idx then
idx, chg = cheat:set_index(idx)