summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
{