diff options
author | Simon Howard | 2011-10-14 18:24:13 +0000 |
---|---|---|
committer | Simon Howard | 2011-10-14 18:24:13 +0000 |
commit | 775132361f9364295591a12b955a4507f07406c2 (patch) | |
tree | d5c7d0337da593257a3deefdc33ef6bee9f1c69d | |
parent | 2344223e648ca693945fe014bb3162c272bf27ec (diff) | |
download | chocolate-doom-775132361f9364295591a12b955a4507f07406c2.tar.gz chocolate-doom-775132361f9364295591a12b955a4507f07406c2.tar.bz2 chocolate-doom-775132361f9364295591a12b955a4507f07406c2.zip |
Fix overflow of playeringame[] caused by smaller MAXPLAYERS.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2424
-rw-r--r-- | src/hexen/p_mobj.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c index 388440ac..f716ad4d 100644 --- a/src/hexen/p_mobj.c +++ b/src/hexen/p_mobj.c @@ -1303,10 +1303,11 @@ void P_SpawnPlayer(mapthing_t * mthing) fixed_t x, y, z; mobj_t *mobj; - if (!playeringame[mthing->type - 1]) + if (mthing->type - 1 >= MAXPLAYERS || !playeringame[mthing->type - 1]) { // Not playing return; } + p = &players[mthing->type - 1]; if (p->playerstate == PST_REBORN) { |