fix: chat color codes not rendering in singleplayer

PlayerConnection::handleChat called FormatChatMessage with
applyStyling=false before broadcasting, which stripped all color codes
from the message. The client then had nothing left to format. Send the
raw message and let the client handle formatting on receive.
This commit is contained in:
itsRevela
2026-04-17 07:06:39 -05:00
parent 59f9dbc8c6
commit eb5aa9fa8f

View File

@@ -969,7 +969,7 @@ void PlayerConnection::handleChat(shared_ptr<ChatPacket> packet)
}
#else
wstring formatted = L"<" + player->name + L"> " + message;
server->getPlayers()->broadcastAll(shared_ptr<ChatPacket>(new ChatPacket(app.FormatChatMessage(formatted, false))));
server->getPlayers()->broadcastAll(shared_ptr<ChatPacket>(new ChatPacket(formatted)));
#endif
chatSpamTickCount += SharedConstants::TICKS_PER_SECOND;
if (chatSpamTickCount > SharedConstants::TICKS_PER_SECOND * 10)