Add NULL mthing check to P_SpawnPlayer

This commit is contained in:
Randy Heit 2016-03-08 21:42:24 -06:00
parent 48b6b6e057
commit 174e00afe7
1 changed files with 4 additions and 0 deletions

View File

@ -4603,6 +4603,10 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
fixed_t spawn_x, spawn_y, spawn_z;
angle_t spawn_angle;
if (mthing == NULL)
{
return NULL;
}
// not playing?
if ((unsigned)playernum >= (unsigned)MAXPLAYERS || !playeringame[playernum])
return NULL;