Fix special map usage
- Free header on `CLEAR LEVELS` even if it's `tutorialmap` - `titlemap` infinite recursion prevention Z_Free's instead of leaking
This commit is contained in:
parent
bde16b96a0
commit
1b53d6b4bf
3 changed files with 3 additions and 5 deletions
|
|
@ -151,9 +151,6 @@ void clear_levels(void)
|
|||
if (!mapheaderinfo[nummapheaders])
|
||||
continue;
|
||||
|
||||
if (strcmp(mapheaderinfo[nummapheaders]->lumpname, tutorialmap) == 0) // Sal: Is this needed...?
|
||||
continue;
|
||||
|
||||
// Custom map header info
|
||||
// (no need to set num to 0, we're freeing the entire header shortly)
|
||||
Z_Free(mapheaderinfo[nummapheaders]->customopts);
|
||||
|
|
|
|||
|
|
@ -1145,7 +1145,7 @@ void F_StartTitleScreen(void)
|
|||
globalweather = mapheaderinfo[titleMapNum]->weather;
|
||||
|
||||
G_DoLoadLevel(true);
|
||||
if (!titleMapNum)
|
||||
if (!titlemap)
|
||||
return;
|
||||
|
||||
players[displayplayers[0]].playerstate = PST_DEAD; // Don't spawn the player in dummy (I'm still a filthy cheater)
|
||||
|
|
|
|||
|
|
@ -1361,7 +1361,8 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
{
|
||||
if (gamemap < 1 || gamemap > nummapheaders)
|
||||
{
|
||||
titlemap = 0; // let's not infinite recursion ok
|
||||
Z_Free(titlemap);
|
||||
titlemap = NULL; // let's not infinite recursion ok
|
||||
Command_ExitGame_f();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue