commit 775132361f9364295591a12b955a4507f07406c2
Author: Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 14 18:24:13 2011 +0000
Commit: Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 14 18:24:13 2011 +0000
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(-)
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)
{