From be77093151bb9226d59405cc4618ef0669b10952 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 15 Jan 2025 00:59:33 +0300 Subject: [PATCH] Fix durability Regex for tooltip parsing --- Core.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core.lua b/Core.lua index 5db895e..bde961f 100644 --- a/Core.lua +++ b/Core.lua @@ -73,7 +73,9 @@ end -- Turns a game constant with "%d" placeholders into a pattern that can be used to match that string. function PawnGameConstantIgnoredNumberPlaceholder(Text) - return gsub(PawnGameConstant(Text), "%%%%d", "%%d+") + -- gsub may return second result - amount of substitutions. Just ignore it. + local value, _ = gsub(PawnGameConstant(Text), "%%%%d", "%%d+") + return value end -- Escapes a string so that it can be more easily printed.