From bc0735c02724f28050665814734869efda994ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Sat, 21 Dec 2024 12:33:00 +0100 Subject: [PATCH] Fix segfault due to leftover ztargetfocus when switching maps --- src/g_game.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 175e757ec..6f02fde3c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1867,6 +1867,10 @@ void G_DoLoadLevel(boolean resetplayer) if (gamestate == GS_INTERMISSION) Y_EndIntermission(); + // clear the target on map change, since the object will be invalidated + P_SetTarget(&ticcmd_ztargetfocus[0], NULL); + P_SetTarget(&ticcmd_ztargetfocus[1], NULL); + // cleanup if (titlemapinaction == TITLEMAP_LOADING) {