summaryrefslogtreecommitdiff
path: root/src/am_map.c
diff options
context:
space:
mode:
authorSimon Howard2007-08-09 00:04:03 +0000
committerSimon Howard2007-08-09 00:04:03 +0000
commitf0c7aa035a81c84e26edd0cd9aafd13f00e0a2fe (patch)
tree3089afec3d9a21dbc9bc0237fed133f5af208f9e /src/am_map.c
parent7e59c3bc40bf8c3ffdd5d43978160feb643d71d2 (diff)
downloadchocolate-doom-f0c7aa035a81c84e26edd0cd9aafd13f00e0a2fe.tar.gz
chocolate-doom-f0c7aa035a81c84e26edd0cd9aafd13f00e0a2fe.tar.bz2
chocolate-doom-f0c7aa035a81c84e26edd0cd9aafd13f00e0a2fe.zip
Don't crash when all players have quit.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 955
Diffstat (limited to 'src/am_map.c')
-rw-r--r--src/am_map.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/am_map.c b/src/am_map.c
index 347d592f..cad46a70 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -472,13 +472,21 @@ 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])
+ {
for (pnum=0;pnum<MAXPLAYERS;pnum++)
+ {
if (playeringame[pnum])
+ {
+ plr = &players[pnum];
break;
-
- plr = &players[pnum];
+ }
+ }
+ }
+
m_x = plr->mo->x - m_w/2;
m_y = plr->mo->y - m_h/2;
AM_changeWindowLoc();