From 775132361f9364295591a12b955a4507f07406c2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 14 Oct 2011 18:24:13 +0000 Subject: Fix overflow of playeringame[] caused by smaller MAXPLAYERS. Subversion-branch: /branches/v2-branch Subversion-revision: 2424 --- src/hexen/p_mobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3