Merge branch 'fix-segfault-leftover-ztargetfocus' into 'next'

Fix segfault due to leftover ztargetfocus when switching maps

Closes #1333

See merge request STJr/SRB2!2573
This commit is contained in:
LJ Sonic 2024-12-31 15:55:09 +00:00
commit faf87ea250

View file

@ -7853,6 +7853,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
maptol = mapheaderinfo[gamemap-1]->typeoflevel;
gametyperules = gametypedefaultrules[gametype];
// clear the target on map change, since the object will be invalidated
P_SetTarget(&ticcmd_ztargetfocus[0], NULL);
P_SetTarget(&ticcmd_ztargetfocus[1], NULL);
CON_Drawer(); // let the user know what we are going to do
I_FinishUpdate(); // page flip or blit buffer