Fix Golden trinket modifiers affecting the same number more than once in some situations (#854)
This commit is contained in:
1 parent
acdcdcdd08
commit
ed7d7b6842
1 file changed
+5
-5
@@ -588,10 +588,10 @@ if EID.isRepentance then
|
|||||||
|
|
||||||
--replacing numeric text based on our multiplier
|
--replacing numeric text based on our multiplier
|
||||||
if (data.t) then
|
if (data.t) then
|
||||||
for _,v in ipairs(data.t) do
|
--"%d*%.?%d+" will grab every number group (1, 10, 0.5), this will allow us to not replace the "1" in "10" erroneously
|
||||||
|
descObj.Description = string.gsub(descObj.Description, "%d*%.?%d+", function(s)
|
||||||
count = 0
|
count = 0
|
||||||
--"%d*%.?%d+" will grab every number group (1, 10, 0.5), this will allow us to not replace the "1" in "10" erroneously
|
for _, v in ipairs(data.t) do
|
||||||
descObj.Description = string.gsub(descObj.Description, "%d*%.?%d+", function(s)
|
|
||||||
if (s == tostring(v) and count == 0) then
|
if (s == tostring(v) and count == 0) then
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if v == 17 then
|
if v == 17 then
|
||||||
@@ -600,8 +600,8 @@ if EID.isRepentance then
|
|||||||
elseif v == 33 and (multiplier == 1.5 or multiplier == 3) then v = (1/3)*100 end -- convert 33% to 50% or 100%
|
elseif v == 33 and (multiplier == 1.5 or multiplier == 3) then v = (1/3)*100 end -- convert 33% to 50% or 100%
|
||||||
return "{{ColorGold}}" .. string.format("%.4g",v * multiplier + addition) .. "{{CR}}"
|
return "{{ColorGold}}" .. string.format("%.4g",v * multiplier + addition) .. "{{CR}}"
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
end
|
end)
|
||||||
end
|
end
|
||||||
--replacing a phrase, such as "half a heart"
|
--replacing a phrase, such as "half a heart"
|
||||||
if data.findReplace then
|
if data.findReplace then
|
||||||
|
|||||||
Reference in new issue
Block a user