From 0e5606d0e60a72b2c8ed8c9f50c2e3d31aa87858 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Wed, 11 Jun 2025 23:15:33 +0200 Subject: [PATCH] Fixed GoldenTrinket replacements not being detected correctly related to #874 --- features/eid_modifiers.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/eid_modifiers.lua b/features/eid_modifiers.lua index d60f36b3..4af5f36e 100644 --- a/features/eid_modifiers.lua +++ b/features/eid_modifiers.lua @@ -583,12 +583,14 @@ if EID.isRepentance then --replacing numeric text based on our multiplier if (data.t) then + local numReplacements = 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) count = 0 for _, v in ipairs(data.t) do if (s == tostring(v) and count == 0) then count = count + 1 + numReplacements = numReplacements + 1 if v == 17 then if multiplier == 2 then v = 16.5 elseif multiplier == 3 then v = (1/6)*100 end -- convert 17% to 33% or 50% @@ -597,6 +599,7 @@ if EID.isRepentance then end end end) + count = count + numReplacements end --replacing a phrase, such as "half a heart" if data.findReplace then