Strip material text icons from chat messages
This commit is contained in:
parent
e84e0774a6
commit
a7a8207a34
@ -76,6 +76,29 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
void Dedicated::StripMaterialTextIcons(char* text)
|
||||
{
|
||||
char* currentChar = text;
|
||||
bool isEscaped = false;
|
||||
while (*currentChar)
|
||||
{
|
||||
if (*currentChar == '^')
|
||||
{
|
||||
isEscaped = true;
|
||||
}
|
||||
else if(isEscaped == true && (*currentChar == '\x01' || *currentChar == '\x02'))
|
||||
{
|
||||
*currentChar = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
isEscaped = false;
|
||||
}
|
||||
|
||||
currentChar++;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Dedicated::EvaluateSay(char* text, Game::gentity_t* player)
|
||||
{
|
||||
Dedicated::SendChat = true;
|
||||
@ -87,6 +110,8 @@ namespace Components
|
||||
++text;
|
||||
}
|
||||
|
||||
StripMaterialTextIcons(text);
|
||||
|
||||
Game::Scr_AddEntity(player);
|
||||
Game::Scr_AddString(text + 1);
|
||||
Game::Scr_NotifyLevel(Game::SL_GetString("say", 0), 2);
|
||||
|
@ -14,6 +14,8 @@ namespace Components
|
||||
|
||||
static void Heartbeat();
|
||||
|
||||
static void StripMaterialTextIcons(char* text);
|
||||
|
||||
private:
|
||||
static bool SendChat;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user