mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
Fixed crash on chat message
This commit is contained in:
parent
922f8ef582
commit
31f6896814
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include "audio/external.h"
|
#include "audio/external.h"
|
||||||
#include "game/mario_misc.h"
|
#include "game/mario_misc.h"
|
||||||
#include "djui.h"
|
#include "djui.h"
|
||||||
|
#include "pc/debuglog.h"
|
||||||
|
|
||||||
#define DJUI_CHAT_LIFE_TIME 10.0f
|
#define DJUI_CHAT_LIFE_TIME 10.0f
|
||||||
|
|
||||||
|
@ -45,6 +46,10 @@ static void djui_chat_message_destroy(struct DjuiBase* base) {
|
||||||
|
|
||||||
void djui_chat_message_create_from(u8 globalIndex, const char* message) {
|
void djui_chat_message_create_from(u8 globalIndex, const char* message) {
|
||||||
struct NetworkPlayer* np = network_player_from_global_index(globalIndex);
|
struct NetworkPlayer* np = network_player_from_global_index(globalIndex);
|
||||||
|
if (np == NULL) {
|
||||||
|
LOG_ERROR("Could not find network player, global index: %u", globalIndex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char* playerColorString = network_get_player_text_color_string(np->localIndex);
|
char* playerColorString = network_get_player_text_color_string(np->localIndex);
|
||||||
char chatMsg[256] = { 0 };
|
char chatMsg[256] = { 0 };
|
||||||
|
|
Loading…
Reference in a new issue