Fix client_print_color where the color is ignored if string starts with an unicode character (#504)
This commit is contained in:
parent
4ae31f6f26
commit
9700caefae
|
@ -338,7 +338,7 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para
|
||||||
g_langMngr.SetDefLang(i);
|
g_langMngr.SetDefLang(i);
|
||||||
msg = format_amxstring(amx, params, 3, len);
|
msg = format_amxstring(amx, params, 3, len);
|
||||||
|
|
||||||
if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored.
|
if (static_cast<byte>(*msg) > 4) // Insert default color code at the start if not present, otherwise message will not be colored.
|
||||||
{
|
{
|
||||||
memmove(msg + 1, msg, ke::Min(len++, 191));
|
memmove(msg + 1, msg, ke::Min(len++, 191));
|
||||||
*msg = 1;
|
*msg = 1;
|
||||||
|
@ -376,7 +376,7 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para
|
||||||
|
|
||||||
msg = format_amxstring(amx, params, 3, len);
|
msg = format_amxstring(amx, params, 3, len);
|
||||||
|
|
||||||
if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored.
|
if (static_cast<byte>(*msg) > 4) // Insert default color code at the start if not present, otherwise message will not be colored.
|
||||||
{
|
{
|
||||||
memmove(msg + 1, msg, ke::Min(len++, 191));
|
memmove(msg + 1, msg, ke::Min(len++, 191));
|
||||||
*msg = 1;
|
*msg = 1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user