(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,18 +187,22 @@ 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],
spellIcon = v[4], spellIcon = v[4],
spellID = v[5], spellID = v[5],
spellCategory = v[6] spellCategory = v[6]
}; };
--self:Print(v[1] .. v[2] .. v[3] .. v[4] .. v[5]) if ttmp then
--self:Print(tmp[i]["currentTime"] .. " " .. tmp[i]["endTime"] .. " " .. tmp[i]["cd"]);-- .. " " .. tmp[i][4] .. " " .. tmp[i][5]) tmp[i] = ttmp;
i = i + 1;
--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])
i = i + 1;
end
end end
end end