summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat/init.lua
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2020-09-13 19:03:22 -0500
committer cracyc <cracyc@users.noreply.github.com>2020-09-13 19:03:22 -0500
commit35bfe62b592457df22bd0c027173971aaa5b04a3 (patch)
tree712f05f139fcfd796a19a7b05a04335ab7f471d9 /plugins/cheat/init.lua
parent0d3b24b32c1b17abfcfc28661cae1e1b65b920e0 (diff)
plugin/cheat: check value is a mulitple of step
Diffstat (limited to 'plugins/cheat/init.lua')
-rw-r--r--plugins/cheat/init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index 10cda2d4cdd..418489f9525 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -569,7 +569,11 @@ function cheat.startplugin()
end
cheat.set_index = set_index;
cheat.set_value = function(cheat, value)
- local idx, chg = cheat:set_index((value / cheat.parameter.step) + 1)
+ local idx = (value / cheat.parameter.step) + 1
+ local chg = false
+ if math.integer(idx) == idx then
+ idx, chg = cheat:set_index(idx)
+ end
return cheat.parameter.value, chg
end
cheat.get_index = function(cheat) return cheat.parameter.index end