Skip to content

Commit cf5b635

Browse files
authored
Merge pull request #19 from wowsims/hotfix/nullable-gems
[FIX] Nullable gems in previous index
2 parents 191ab67 + 5b10918 commit cf5b635

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ExportStructures/ItemSpec.lua

+7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ function ItemSpecMeta:FillFromItemLink(itemLink)
5555
self.enchant = tonumber(enchantId)
5656
if self._structure.gems then
5757
self.gems = { tonumber(gemId1), tonumber(gemId2), tonumber(gemId3), tonumber(gemId4) }
58+
59+
-- Loop over all filled gems and make sure to backwards fill empty (nil) gem slots with 0.
60+
for i = 1, #self.gems do
61+
if i > 1 and self.gems[i] and not self.gems[i - 1] then
62+
self.gems[i - 1] = 0
63+
end
64+
end
5865
end
5966
if self._structure.random_suffix then
6067
self.random_suffix = tonumber(suffixId)

0 commit comments

Comments
 (0)