Skip to content

Commit 9985aaf

Browse files
committed
Update chatManagerUtility.lua
1 parent ccf9b02 commit 9985aaf

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

[managers]/chatmanager/chatManagerUtility.lua

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,15 @@ function getPlayerNickname(playerElement)
1414
return playerName
1515
end
1616

17-
function removeStringHEX(stringToRemoveHEX)
18-
local stringSavedLength = nil
19-
local stringLengthMatching = false
17+
function removeStringHEX(stringText)
18+
local stringSavedLength
2019

21-
while (not stringLengthMatching) do
22-
stringSavedLength = utf8.len(stringToRemoveHEX)
23-
stringToRemoveHEX = string.gsub(stringToRemoveHEX, "#%x%x%x%x%x%x", "")
20+
repeat
21+
stringSavedLength = utf8.len(stringText)
22+
stringText = string.gsub(stringText, "#%x%x%x%x%x%x", "")
23+
until utf8.len(stringText) == stringSavedLength
2424

25-
local stringLengthNow = utf8.len(stringToRemoveHEX)
26-
27-
stringLengthMatching = (stringLengthNow == stringSavedLength)
28-
end
29-
30-
return stringToRemoveHEX
25+
return stringText
3126
end
3227

3328
function getOrSetPlayerDelay(playerElement, delayID, delayTime)

0 commit comments

Comments
 (0)