From a48511b566699f835acd754eae803bb73510706e Mon Sep 17 00:00:00 2001 From: Paliak <91493239+Paliak@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:13:49 +0100 Subject: [PATCH] FIX: incorrect parsing of non-exceptional keyword Parsing of the Gem-lined Cap Ascendancy Notable mod "+3 to Level on all non-Exceptional Support Gems" was incorrect due to faulty handling of the hyphen causing "non-exceptional" to be split into two keywords: "non" and "exceptional". This caused the mod to not apply as there does not exist a gem tag called "non". This commit fixes this by improving handling of non space characters in the keyword string and implementing handling for the negation part in "non-exceptional" inside of calcLib.gemIsType function. --- src/Modules/CalcTools.lua | 1 + src/Modules/ModParser.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Modules/CalcTools.lua b/src/Modules/CalcTools.lua index a7efd4597e..7adf69f1f1 100644 --- a/src/Modules/CalcTools.lua +++ b/src/Modules/CalcTools.lua @@ -113,6 +113,7 @@ function calcLib.gemIsType(gem, type, includeTransfigured) (type == "trap or mine" and (gem.tags.trap or gem.tags.mine)) or ((type == "active skill" or type == "grants_active_skill" or type == "skill") and gem.tags.grants_active_skill and not gem.tags.support) or (type == "non-vaal" and not gem.tags.vaal) or + (type == "non-exceptional" and not gem.tags.exceptional) or (type == gem.name:lower()) or (type == gem.name:lower():gsub("^vaal ", "")) or (includeTransfigured and calcLib.isGemIdSame(gem.name, type, true)) or diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 6eec4fb7d1..11d9ef58f6 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2872,7 +2872,7 @@ local specialModList = { return { mod("GemProperty", "LIST", {keyword = skill, key = "level", value = num }) } end local wordList = {} - for tag in skill:gmatch("%w+") do + for tag in skill:gmatch("%S+") do table.insert(wordList, tag) end return { mod("GemProperty", "LIST", {keywordList = wordList, key = property, value = num }) }