From 4a59fa49dc5639d6345994b9412fa4bf471675f6 Mon Sep 17 00:00:00 2001 From: skyjake Date: Tue, 19 Apr 2011 19:17:22 +0300 Subject: [PATCH] Client: Fixed showing of HUD messages sent by server The DDPF_LOCAL flag should not be relied upon. --- doomsday/plugins/common/src/d_net.c | 3 +++ doomsday/plugins/common/src/d_netsv.c | 4 ++++ doomsday/plugins/common/src/hu_log.c | 2 +- doomsday/plugins/common/src/p_player.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doomsday/plugins/common/src/d_net.c b/doomsday/plugins/common/src/d_net.c index 038659c3f2..fb298adb30 100644 --- a/doomsday/plugins/common/src/d_net.c +++ b/doomsday/plugins/common/src/d_net.c @@ -469,6 +469,9 @@ void D_HandlePacket(int fromplayer, int type, void *data, size_t length) break; case GPT_MESSAGE: +#ifdef _DEBUG + Con_Message("D_HandlePacket: GPT_MESSAGE\n"); +#endif dd_snprintf(msgBuff, NETBUFFER_MAXMESSAGE, "%s", (char*) data); P_SetMessage(&players[CONSOLEPLAYER], msgBuff, false); break; diff --git a/doomsday/plugins/common/src/d_netsv.c b/doomsday/plugins/common/src/d_netsv.c index d46c3862f9..05adafde7c 100644 --- a/doomsday/plugins/common/src/d_netsv.c +++ b/doomsday/plugins/common/src/d_netsv.c @@ -1504,6 +1504,10 @@ void NetSv_SendMessageEx(int plrNum, char *msg, boolean yellow) if(!players[plrNum].plr->inGame) return; +#ifdef _DEBUG + Con_Message("NetSv_SendMessageEx: Message '%s'\n", msg); +#endif + if(plrNum == DDSP_ALL_PLAYERS) { // Also show locally. No sound is played! diff --git a/doomsday/plugins/common/src/hu_log.c b/doomsday/plugins/common/src/hu_log.c index c573e98c90..6dc6cac535 100644 --- a/doomsday/plugins/common/src/hu_log.c +++ b/doomsday/plugins/common/src/hu_log.c @@ -447,7 +447,7 @@ void Hu_LogPost(int player, byte flags, const char* msg) return; plr = &players[player]; - if(!((plr->plr->flags & DDPF_LOCAL) && plr->plr->inGame)) + if(!plr->plr->inGame) return; log = &msgLogs[player]; diff --git a/doomsday/plugins/common/src/p_player.c b/doomsday/plugins/common/src/p_player.c index f7d158334a..f7b40471db 100644 --- a/doomsday/plugins/common/src/p_player.c +++ b/doomsday/plugins/common/src/p_player.c @@ -741,7 +741,7 @@ void P_PlayerChangeClass(player_t* player, playerclass_t newClass) */ void P_SetMessage(player_t* pl, char *msg, boolean noHide) { - byte flags = (noHide? LMF_NOHIDE : 0); + byte flags = (noHide? LMF_NOHIDE : 0); Hu_LogPost(pl - players, flags, msg);