foxygit / doom Log in
commit a1b99817a728a15635f6fd93f147bd6f99c6d9ec
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 14 19:01:22 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 14 19:01:22 2011 +0000

    Fix player exit message in Hexen, and add note to player exit code in
    Heretic.

    Subversion-branch: /branches/v2-branch
    Subversion-revision: 2425
---
 src/heretic/d_net.c | 10 +++++-----
 src/hexen/d_net.c   | 14 +++++---------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/heretic/d_net.c b/src/heretic/d_net.c
index 3656f928..73e9d996 100644
--- a/src/heretic/d_net.c
+++ b/src/heretic/d_net.c
@@ -55,13 +55,13 @@ static void PlayerQuitGame(player_t *player)

     player_num = player - players;

-    // Do this the same way as Vanilla Doom does, to allow dehacked
-    // replacements of this message
-
-    strncpy(exitmsg, DEH_String("Player 1 left the game"), sizeof(exitmsg));
-    exitmsg[sizeof(exitmsg) - 1] = '\0';
+    // Note:
+    // The Heretic source code does this, which doesn't actually work.
+    // As a result, the exit message is never seen.

+    strcpy(exitmsg, "PLAYER 1 LEFT THE GAME");
     exitmsg[7] += player_num;
+    players[consoleplayer].message = exitmsg;

     playeringame[player_num] = false;
     players[consoleplayer].message = exitmsg;
diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c
index 21499881..73b517a9 100644
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -34,6 +34,8 @@
 #include "i_timer.h"
 #include "i_video.h"
 #include "h2def.h"
+#include "p_local.h"
+#include "s_sound.h"

 #include "deh_main.h"

@@ -57,16 +59,10 @@ static void PlayerQuitGame(player_t *player)

     player_num = player - players;

-    /* TODO
-    // Do this the same way as Vanilla Doom does, to allow dehacked
-    // replacements of this message
-
-    strncpy(exitmsg, DEH_String("Player 1 left the game"), sizeof(exitmsg));
-    exitmsg[sizeof(exitmsg) - 1] = '\0';
-
+    strcpy(exitmsg, "PLAYER 1 LEFT THE GAME");
     exitmsg[7] += player_num;
-    players[consoleplayer].message = exitmsg;
-*/
+    P_SetMessage(&players[consoleplayer], exitmsg, true);
+    S_StartSound(NULL, SFX_CHAT);

     playeringame[player_num] = false;