Fix client_print_color where the color is ignored if string starts with an unicode character (#504)

This commit is contained in:
Vincent Herbet 2018-07-24 15:45:50 +02:00 committed by GitHub
parent 4ae31f6f26
commit 9700caefae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;