Skip to content

Commit

Permalink
prevent lua error when hands have no jack diff
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Sep 4, 2021
1 parent 37ffe68 commit 9adae51
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Themes/Til Death/BGAnimations/_calcdisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,13 @@ o[#o + 1] = Def.Quad {
local jklosstxt = ""
for h = 1,2 do
local hnd = h == 1 and "Left" or "Right"
local hand = h == 1 and "L" or "R"
local index = convertPercentToIndexForJack(mx - leftEnd, rightEnd - leftEnd, jackdiffs[hnd])
jktxt = jktxt .. string.format("%s: %5.4f\n", "Jack"..hand, jackdiffs[hnd][index][2])
jkstmtxt = jkstmtxt .. string.format("%s: %5.4f\n", "Jack Stam"..hand, jackdiffs[hnd][index][3])
jklosstxt = jklosstxt .. string.format("%s: %5.4f\n", "Jack Loss"..hand, jackdiffs[hnd][index][4])
if jackdiffs[hnd] ~= nil and #jackdiffs[hnd] > 0 then
local hand = h == 1 and "L" or "R"
local index = convertPercentToIndexForJack(mx - leftEnd, rightEnd - leftEnd, jackdiffs[hnd])
jktxt = jktxt .. string.format("%s: %5.4f\n", "Jack"..hand, jackdiffs[hnd][index][2])
jkstmtxt = jkstmtxt .. string.format("%s: %5.4f\n", "Jack Stam"..hand, jackdiffs[hnd][index][3])
jklosstxt = jklosstxt .. string.format("%s: %5.4f\n", "Jack Loss"..hand, jackdiffs[hnd][index][4])
end
end
modText = modText .. jktxt .. jkstmtxt .. jklosstxt
modText = modText:sub(1, #modText-1) -- remove the end whitespace
Expand Down

0 comments on commit 9adae51

Please sign in to comment.