From bbd22ad1afc7dd5f7e000fa553cc0f173b37f3f8 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sat, 22 Mar 2025 14:46:07 -0400 Subject: [PATCH] Hack to fix R_IsViewpointThirdPerson crashing due to invalid player ref Basically to explain due to R_InterpolateView being called here it can possibly pass an invalid player ref to R_IsViewpointThirdPerson since the player mobj hasn't been created yet. Thanks to GenericHeroGuy for helping me figure this out. --- src/st_stuff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index d108a1c9c..c9e9777b8 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -918,7 +918,10 @@ void ST_Drawer(void) stplyr = &players[displayplayers[i]]; stplyrnum = i; R_SetViewContext(VIEWCONTEXT_PLAYER1 + i); - R_InterpolateView(rendertimefrac); // to assist with object tracking + + // HACK: This can possibly crash the game in R_IsViewpointThirdPerson during first two tics if the player object doesn't exist. + if (stplyr->mo) + R_InterpolateView(rendertimefrac); // to assist with object tracking ST_overlayDrawer(); }