Skip to content

Commit c9c892a

Browse files
Fix energy blade not importing on copy paste (#5607)
* Fix energy blade not importing on copy paste * Fix crash with existing energy blades from gem.
1 parent 2529cd9 commit c9c892a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Classes/Item.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ function ItemClass:ParseRaw(raw)
8282
end
8383
local mode = "WIKI"
8484
local l = 1
85+
local itemClass
8586
if self.rawLines[l] then
8687
if self.rawLines[l]:match("^Item Class:") then
88+
itemClass = self.rawLines[l]:gsub("^Item Class: %s+", "%1")
8789
l = l + 1 -- Item class is already determined by the base type
8890
end
8991
local rarity = self.rawLines[l]:match("^Rarity: (%a+)")
@@ -116,7 +118,7 @@ function ItemClass:ParseRaw(raw)
116118
end
117119

118120
-- Found the name for a rare or unique, but let's parse it if it's a magic or normal or Unidentified item to get the base
119-
if not (self.rarity == "NORMAL" or self.rarity == "MAGIC" or unidentified) then
121+
if not (self.rarity == "NORMAL" or self.rarity == "MAGIC" or unidentified) or self.name:match("Energy Blade") then
120122
l = l + 1
121123
end
122124
end
@@ -395,6 +397,9 @@ function ItemClass:ParseRaw(raw)
395397
local baseName
396398
if self.rarity == "NORMAL" or self.rarity == "MAGIC" then
397399
-- Exact match (affix-less magic and normal items)
400+
if self.name:match("Energy Blade") and itemClass then -- Special handling for energy blade base.
401+
self.name = itemClass:match("One Hand") and "Energy Blade One Handed" or "Energy Blade Two Handed"
402+
end
398403
if data.itemBases[self.name] then
399404
baseName = self.name
400405
else

0 commit comments

Comments
 (0)