From 35bfe62b592457df22bd0c027173971aaa5b04a3 Mon Sep 17 00:00:00 2001 From: cracyc Date: Sun, 13 Sep 2020 19:03:22 -0500 Subject: plugin/cheat: check value is a mulitple of step --- plugins/cheat/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/cheat/init.lua') 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 -- cgit v1.2.3-70-g09d2