mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-02 21:22:40 +00:00
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
f5998c7624
commit
fe2757cb44
3 changed files with 3 additions and 5 deletions
|
|
@ -149,9 +149,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);
|
||||
|
|
|
|||
|
|
@ -1865,7 +1865,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)
|
||||
|
|
|
|||
|
|
@ -1336,7 +1336,8 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
//if (W_CheckNumForName(G_BuildMapName(gamemap)) == LUMPERROR)
|
||||
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…
Add table
Reference in a new issue