Skip to content

Commit

Permalink
Client: Fixed showing of HUD messages sent by server
Browse files Browse the repository at this point in the history
The DDPF_LOCAL flag should not be relied upon.
  • Loading branch information
skyjake committed Apr 19, 2011
1 parent c62ce77 commit 4a59fa4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doomsday/plugins/common/src/d_net.c
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions doomsday/plugins/common/src/d_netsv.c
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/hu_log.c
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/p_player.c
Expand Up @@ -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);

Expand Down

0 comments on commit 4a59fa4

Please sign in to comment.