Fix segfault due to leftover ztargetfocus when switching maps

This commit is contained in:
Gustaf Alhäll 2024-12-21 12:33:00 +01:00
parent 14606ebe30
commit bc0735c027

View file

@ -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)
{