From fec24381dfdd683a11aaa605da72e93750424951 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 2 Mar 2023 23:40:54 -0800 Subject: [PATCH] Fix FAULT crash if no finish line waypoint --- src/k_respawn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/k_respawn.c b/src/k_respawn.c index cb08408a2..da07b2b5f 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -150,8 +150,10 @@ void K_DoIngameRespawn(player_t *player) // FAULT if ((gametyperules & GTR_CIRCUIT) && leveltime < starttime) { - if (!(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE)) - player->respawn.wp = K_GetFinishLineWaypoint()->prevwaypoints[0]; + const waypoint_t *finish = K_GetFinishLineWaypoint(); + + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE) && finish != NULL) + player->respawn.wp = finish->prevwaypoints[0]; K_DoFault(player); }