Skip to content

Commit 551a68f

Browse files
committed
Fix for people typing in a decimal value by mistake
1 parent 2640d93 commit 551a68f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: FX/Lokasenna_Toggle FX bypass by track and slot.lua

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
--[[
22
Description: Toggle FX bypass by track and slot
3-
Version: 1.32
3+
Version: 1.33
44
Author: Lokasenna
55
Donation: https://paypal.me/Lokasenna
66
Changelog:
7-
Fix for me still being an idiot and trying to make words be numbers
7+
Fix for crashes if someone types in a decimal value by mistake
88
Links:
99
Forum thread https://forum.cockos.com/showthread.php?p=1993961
1010
Lokasenna's Website http://forum.cockos.com/member.php?u=10417
@@ -68,7 +68,11 @@ local function toggle_bypass()
6868

6969
-- Get the track
7070
-- Track number?
71-
if tonumber(track) then
71+
if tonumber(track) then
72+
73+
-- Force an integer until/unless I come up with some sort of multiple track syntax
74+
track = math.floor( tonumber(track) )
75+
7276
tr = tonumber(track) > 0 and reaper.GetTrack(0, tonumber(track) - 1)
7377
or reaper.GetMasterTrack(0)
7478

@@ -104,7 +108,8 @@ local function toggle_bypass()
104108

105109
if tonumber(slot) then
106110

107-
s = tonumber(slot) - 1
111+
-- Force an integer until/unless I come up with some sort of multiple FX syntax
112+
s = math.floor( tonumber(slot) ) - 1
108113

109114
elseif tostring(slot) then
110115

0 commit comments

Comments
 (0)