mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +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])
|
if (!mapheaderinfo[nummapheaders])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp(mapheaderinfo[nummapheaders]->lumpname, tutorialmap) == 0) // Sal: Is this needed...?
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Custom map header info
|
// Custom map header info
|
||||||
// (no need to set num to 0, we're freeing the entire header shortly)
|
// (no need to set num to 0, we're freeing the entire header shortly)
|
||||||
Z_Free(mapheaderinfo[nummapheaders]->customopts);
|
Z_Free(mapheaderinfo[nummapheaders]->customopts);
|
||||||
|
|
|
||||||
|
|
@ -1865,7 +1865,7 @@ void F_StartTitleScreen(void)
|
||||||
globalweather = mapheaderinfo[titleMapNum]->weather;
|
globalweather = mapheaderinfo[titleMapNum]->weather;
|
||||||
|
|
||||||
G_DoLoadLevel(true);
|
G_DoLoadLevel(true);
|
||||||
if (!titleMapNum)
|
if (!titlemap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
players[displayplayers[0]].playerstate = PST_DEAD; // Don't spawn the player in dummy (I'm still a filthy cheater)
|
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 (W_CheckNumForName(G_BuildMapName(gamemap)) == LUMPERROR)
|
||||||
if (gamemap < 1 || gamemap > nummapheaders)
|
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();
|
Command_ExitGame_f();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue