summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2011-10-14 18:24:13 +0000
committerSimon Howard2011-10-14 18:24:13 +0000
commit775132361f9364295591a12b955a4507f07406c2 (patch)
treed5c7d0337da593257a3deefdc33ef6bee9f1c69d
parent2344223e648ca693945fe014bb3162c272bf27ec (diff)
downloadchocolate-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.c3
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)
{