From ed7d7b68422f06016bd5dff19dec980095d899f4 Mon Sep 17 00:00:00 2001 From: catinsurance <65452914+catinsurance@users.noreply.github.com> Date: Tue, 13 May 2025 04:43:52 -0700 Subject: [PATCH] Fix Golden trinket modifiers affecting the same number more than once in some situations (#854) --- features/eid_modifiers.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/eid_modifiers.lua b/features/eid_modifiers.lua index 02d7236f..a1b96b2d 100644 --- a/features/eid_modifiers.lua +++ b/features/eid_modifiers.lua @@ -588,10 +588,10 @@ if EID.isRepentance then --replacing numeric text based on our multiplier 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 - --"%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) + for _, v in ipairs(data.t) do if (s == tostring(v) and count == 0) then count = count + 1 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% return "{{ColorGold}}" .. string.format("%.4g",v * multiplier + addition) .. "{{CR}}" end - end) - end + end + end) end --replacing a phrase, such as "half a heart" if data.findReplace then