Fix crash on level load

This commit is contained in:
Sally Coolatta 2021-11-29 07:15:02 -05:00
parent 1550210188
commit 5325431450
3 changed files with 2 additions and 3 deletions

View file

@ -5336,7 +5336,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
}
heightsec = thing->subsector->sector->heightsec;
if (viewplayer->mo && viewplayer->mo->subsector)
if (viewplayer && viewplayer->mo && viewplayer->mo->subsector)
phs = viewplayer->mo->subsector->sector->heightsec;
else
phs = -1;

View file

@ -20,7 +20,6 @@
#include "r_plane.h"
#include "p_spec.h"
#include "r_state.h"
#include "doomstat.h" // MAXSPLITSCREENPLAYERS
#ifdef HWRENDER
#include "hardware/hw_main.h" // for cv_glshearing
#endif

View file

@ -1933,7 +1933,7 @@ static void R_ProjectSprite(mobj_t *thing)
}
heightsec = thing->subsector->sector->heightsec;
if (viewplayer->mo && viewplayer->mo->subsector)
if (viewplayer && viewplayer->mo && viewplayer->mo->subsector)
phs = viewplayer->mo->subsector->sector->heightsec;
else
phs = -1;