From 3e92720d47e914798188c79de8bb30bbe4f15344 Mon Sep 17 00:00:00 2001 From: Judd Date: Wed, 23 Sep 2026 01:44:10 -0700 Subject: [PATCH] Fix crash when an item grants a skill below its lowest defined level getGrantedSkillLevel falls back to level 1 when no level at or below the item's level qualifies. The 0.5.5 export defines some granted skills only at higher levels: Pinnacle of Power, granted by Adonia's Ego, has only level 20. levels[1] is then nil and CalcSetup errors while setting the gem's requirements, so any build with the wand fails to calculate. Fall back to the lowest level the skill defines instead. --- src/Modules/CalcSetup.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 76c1bd37ba..e698fff5ad 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -692,7 +692,14 @@ local function getGrantedSkillLevel(gemData, maxLevel, characterLevel, modDB) return level end end - return 1 + -- Some granted skills only define higher levels (Pinnacle of Power has only 20) + local lowest + for level in pairs(gemData.grantedEffect.levels) do + if type(level) == "number" and (not lowest or level < lowest) then + lowest = level + end + end + return lowest or 1 end local defaultAttackSlots = {