Skip to content

Commit 2df5a74

Browse files
LocalIdentityLocalIdentity
andauthored
Fix crash when importing a character that uses Facebreaker gloves (#2098)
When using Facebreakers, the character acts as if it is using a 1 hand mace so it gets the single handed mace strike skill. We assumed that the player had to have a weapon equipped if this skill was in the character list so it would crash when referring to an invalid index Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 7e9d26b commit 2df5a74

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Classes/ImportTab.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,10 @@ function ImportTabClass:ImportItemsAndSkills(charData)
956956

957957
-- This could be done better with the character melee skills data at some point.
958958
if typeLine:match("Mace Strike") then
959-
local weapon1Sel = self.build.itemsTab.activeItemSet["Weapon 1"].selItemId or 0
960-
local weapon2Sel = self.build.itemsTab.activeItemSet["Weapon 2"].selItemId or 0
959+
local weapon1Sel = self.build.itemsTab.activeItemSet["Weapon 1"] and self.build.itemsTab.activeItemSet["Weapon 1"].selItemId or 0
960+
local weapon2Sel = self.build.itemsTab.activeItemSet["Weapon 2"] and self.build.itemsTab.activeItemSet["Weapon 2"].selItemId or 0
961961
if weapon2Sel == 0 then
962-
if self.build.itemsTab.items[weapon1Sel].base.type == "One Hand Mace" then
962+
if weapon1Sel == 0 or self.build.itemsTab.items[weapon1Sel].base.type == "One Hand Mace" then -- Facebreaker uses single handed mace strike
963963
gemId = "Metadata/Items/Gems/SkillGemPlayerDefault1HMace"
964964
elseif self.build.itemsTab.items[weapon1Sel].base.type == "Two Hand Mace" then
965965
gemId = "Metadata/Items/Gems/SkillGemPlayerDefault2HMace"

0 commit comments

Comments
 (0)