1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Fix #3048: Remove format codes in player names and chat

This commit is contained in:
zsilencer
2016-02-29 21:33:46 -07:00
parent f253acbea1
commit 66e406ab75
7 changed files with 15 additions and 5 deletions

View File

@@ -209,6 +209,7 @@ void NetworkPlayer::SetName(const char* name)
{
safe_strcpy((char*)NetworkPlayer::name, name, sizeof(NetworkPlayer::name));
NetworkPlayer::name[sizeof(NetworkPlayer::name) - 1] = 0;
utf8_remove_format_codes((utf8*)NetworkPlayer::name, false);
}
void NetworkPlayer::AddMoneySpent(money32 cost)
@@ -992,7 +993,9 @@ const char* Network::FormatChat(NetworkPlayer* fromplayer, const char* text)
}
lineCh = utf8_write_codepoint(lineCh, FORMAT_OUTLINE);
lineCh = utf8_write_codepoint(lineCh, FORMAT_WHITE);
char* ptrtext = lineCh;
safe_strcpy(lineCh, text, 800);
utf8_remove_format_codes((utf8*)ptrtext, true);
return formatted;
}