Update djui_chat_message.c

If we replace MAX_CHAT_PACKET_LENGTH in these two spots, it fixes the previous issue of having the chat text entry spill over the character limit (resulting in characters at the end of messages that are lost) while raising the character limit to the intended limit of 500. Or 499 more specifically.
This commit is contained in:
occamsaturn 2025-12-15 20:18:42 -08:00 committed by GitHub
parent 983932214a
commit 0dc9457af8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,8 +62,8 @@ void djui_chat_message_create_from(u8 globalIndex, const char* message) {
}
const char* playerColorString = network_get_player_text_color_string(np->localIndex);
char chatMsg[MAX_CHAT_MSG_LENGTH] = { 0 };
snprintf(chatMsg, MAX_CHAT_MSG_LENGTH, "%s%s\\#dcdcdc\\: %s", playerColorString, (np != NULL) ? np->name : "Player", message);
char chatMsg[MAX_CHAT_PACKET_LENGTH] = { 0 };
snprintf(chatMsg, MAX_CHAT_PACKET_LENGTH, "%s%s\\#dcdcdc\\: %s", playerColorString, (np != NULL) ? np->name : "Player", message);
play_sound((globalIndex == gNetworkPlayerLocal->globalIndex) ? SOUND_MENU_MESSAGE_DISAPPEAR : SOUND_MENU_MESSAGE_APPEAR, gGlobalSoundSource);
djui_chat_message_create(chatMsg);