From df197587a3177477713d1907c8fef0c236cb2ef9 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 18 Aug 2025 20:54:23 -0400 Subject: [PATCH] Core/Chat: Fixed chat language translations for messages containing item links using new 11.1.5 color format Port From (https://github.com/TrinityCore/TrinityCore/commit/f84cd43b36c557aff5673ded28d2c557bacddb98) --- Source/Game/Chat/LanguageManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/Game/Chat/LanguageManager.cs b/Source/Game/Chat/LanguageManager.cs index 49aa9266b..ee34e55de 100644 --- a/Source/Game/Chat/LanguageManager.cs +++ b/Source/Game/Chat/LanguageManager.cs @@ -187,7 +187,13 @@ namespace Game.Chat case 'c': case 'C': // skip color - i += 9; + if (i + 2 >= source.Length) + break; + + if (source[i + 2] == 'n') + i = source.IndexOf(':', i); // numeric color id + else + i += 9; break; case 'r': ++i; @@ -232,7 +238,12 @@ namespace Game.Chat static char upper_backslash(char c) { - return c == '/' ? '\\' : char.ToUpper(c); + if (c == '/') + return '\\'; + if (c >= 'a' && c <= 'z') + return (char)('A' + (char)(c - 'a')); + else + return c; } static uint[] s_hashtable =