From 5325431450a0530dab3585d9d696e8bf48f77f71 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 29 Nov 2021 07:15:02 -0500 Subject: [PATCH] Fix crash on level load --- src/hardware/hw_main.c | 2 +- src/r_fps.c | 1 - src/r_things.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index c950e3b32..997978a31 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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; diff --git a/src/r_fps.c b/src/r_fps.c index ca1fa0852..c678c2519 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -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 diff --git a/src/r_things.c b/src/r_things.c index 90a0cb2c9..6c9693d14 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -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;