(Hopefully) fix a rare nil error when sorting cooldowns. Closes #4 (if it works). Thanks.

This commit is contained in:
Relintai 2022-05-10 23:47:52 +02:00
parent d3a10c4781
commit ef84e92e9a

View File

@ -187,7 +187,7 @@ function Rekt:SortCDs(which)
local i = 1; local i = 1;
for k, v in pairs(self.cds[self.targets[which]]) do for k, v in pairs(self.cds[self.targets[which]]) do
if not (k == "spec") then if not (k == "spec") then
tmp[i] = { local ttmp = {
currentTime = v[1], currentTime = v[1],
endTime = v[2], endTime = v[2],
cd = v[3], cd = v[3],
@ -196,11 +196,15 @@ function Rekt:SortCDs(which)
spellCategory = v[6] spellCategory = v[6]
}; };
if ttmp then
tmp[i] = ttmp;
--self:Print(v[1] .. v[2] .. v[3] .. v[4] .. v[5]) --self:Print(v[1] .. v[2] .. v[3] .. v[4] .. v[5])
--self:Print(tmp[i]["currentTime"] .. " " .. tmp[i]["endTime"] .. " " .. tmp[i]["cd"]);-- .. " " .. tmp[i][4] .. " " .. tmp[i][5]) --self:Print(tmp[i]["currentTime"] .. " " .. tmp[i]["endTime"] .. " " .. tmp[i]["cd"]);-- .. " " .. tmp[i][4] .. " " .. tmp[i][5])
i = i + 1; i = i + 1;
end end
end end
end
if not tmp then return end; if not tmp then return end;