foxygit / doom Log in
commit 693fb386fc1ca8551dcea553e3dd667f2f458f61
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Aug 27 19:31:30 2007 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Aug 27 19:31:30 2007 +0000

    Fix bug where the automap always follows player 1 in multiplayer mode
    (thanks Janizdreg!)

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 959
---
 src/am_map.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/am_map.c b/src/am_map.c
index cad46a70..30d140f8 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -472,11 +472,15 @@ void AM_initVariables(void)
     m_w = FTOM(f_w);
     m_h = FTOM(f_h);

-    plr = &players[0];
-
     // find player to center on initially
-    if (!playeringame[pnum = consoleplayer])
+    if (playeringame[consoleplayer])
     {
+        plr = &players[consoleplayer];
+    }
+    else
+    {
+        plr = &players[0];
+
 	for (pnum=0;pnum<MAXPLAYERS;pnum++)
         {
 	    if (playeringame[pnum])