Skip to content

Commit 66d2ccb

Browse files
authored
Fix some radius jewels mods not working correctly (#2264)
* Fix radius jewels only applying the first mod in the list * Clarify Peechey's comment * Remove modcache line * :madashell:
1 parent 7dd7f5d commit 66d2ccb

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

src/Modules/ModParser.lua

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7017,29 +7017,35 @@ local jewelOtherFuncs = {
70177017
["^(%w+) Passive Skills in Radius also grant (.*)$"] = function(passiveType, mod)
70187018
return function(node, out, data)
70197019
if node and (node.type == firstToUpper(passiveType) or (node.type == "Normal" and not node.isAttribute and firstToUpper(passiveType) == "Small")) then
7020-
local modList, line = parseMod(mod)
7021-
if not line and modList[1] then -- something failed to parse, do not add to list
7022-
modList[1].parsedLine = capitalizeWordsInString(mod)
7023-
modList[1].source = data.modSource
7024-
if type(modList[1].value) == "table" and modList[1].value.mod then
7025-
modList[1].value.mod.source = data.modSource
7020+
local modList, extra = parseMod(mod)
7021+
-- avoid adding mods if mod line wasn't parsed correctly
7022+
if not extra and modList[1] then
7023+
for _, modListMod in ipairs(modList) do
7024+
modListMod.parsedLine = capitalizeWordsInString(mod)
7025+
modListMod.source = data.modSource
7026+
if type(modListMod.value) == "table" and modListMod.value.mod then
7027+
modListMod.value.mod.source = data.modSource
7028+
end
7029+
out:AddMod(modListMod)
70267030
end
7027-
out:AddMod(modList[1])
70287031
end
70297032
end
70307033
end
70317034
end,
70327035
["conquered (%w+) Passive Skills also grant (.*)$"] = function(passiveType, mod)
70337036
return function(node, out, data)
70347037
if node and (node.type == firstToUpper(passiveType) or (node.type == "Normal" and not node.isAttribute and firstToUpper(passiveType) == "Small") or (node.type == "Normal" and node.isAttribute and firstToUpper(passiveType) == "Attribute")) then
7035-
local modList, line = parseMod(mod)
7036-
if not line and modList[1] then -- something failed to parse, do not add to list
7037-
modList[1].parsedLine = capitalizeWordsInString(mod)
7038-
modList[1].source = data.modSource
7039-
if type(modList[1].value) == "table" and modList[1].value.mod then
7040-
modList[1].value.mod.source = data.modSource
7038+
local modList, extra = parseMod(mod)
7039+
-- avoid adding mods if mod line wasn't parsed correctly
7040+
if not extra and modList[1] then
7041+
for _, modListMod in ipairs(modList) do
7042+
modListMod.parsedLine = capitalizeWordsInString(mod)
7043+
modListMod.source = data.modSource
7044+
if type(modListMod.value) == "table" and modListMod.value.mod then
7045+
modListMod.value.mod.source = data.modSource
7046+
end
7047+
out:AddMod(modListMod)
70417048
end
7042-
out:AddMod(modList[1])
70437049
end
70447050
end
70457051
end

0 commit comments

Comments
 (0)