From f94763731637c570afcda4d86cfd9a04258c5fc9 Mon Sep 17 00:00:00 2001 From: gononono64 <96976330+gononono64@users.noreply.github.com> Date: Sun, 2 Mar 2025 23:23:18 -0600 Subject: [PATCH] fixed id patterns math.random was being picked twice for the pattern select instead of using char digit at some location --- lib/shared/ids.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/shared/ids.lua b/lib/shared/ids.lua index 17a3099..3091b9b 100644 --- a/lib/shared/ids.lua +++ b/lib/shared/ids.lua @@ -8,7 +8,8 @@ Ids.CreateUniqueId = function(tbl, len, pattern) -- both optional for i = 1, len do local char = "" if pattern then - char = pattern:sub(math.random(1, #pattern), math.random(1, #pattern)) + local charIndex = math.random(1, #pattern) + char = pattern:sub(charIndex, charIndex) else char = math.random(1, 2) == 1 and string.char(math.random(65, 90)) or math.random(0, 9) -- CAP letter and number end