Skip to content

Commit

Permalink
Merge pull request #19 from wowsims/hotfix/nullable-gems
Browse files Browse the repository at this point in the history
[FIX] Nullable gems in previous index
  • Loading branch information
rosenrusinov authored Jun 15, 2024
2 parents 191ab67 + 5b10918 commit cf5b635
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ExportStructures/ItemSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ function ItemSpecMeta:FillFromItemLink(itemLink)
self.enchant = tonumber(enchantId)
if self._structure.gems then
self.gems = { tonumber(gemId1), tonumber(gemId2), tonumber(gemId3), tonumber(gemId4) }

-- Loop over all filled gems and make sure to backwards fill empty (nil) gem slots with 0.
for i = 1, #self.gems do
if i > 1 and self.gems[i] and not self.gems[i - 1] then
self.gems[i - 1] = 0
end
end
end
if self._structure.random_suffix then
self.random_suffix = tonumber(suffixId)
Expand Down

0 comments on commit cf5b635

Please sign in to comment.