mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Create G_FreeGhosts, for the benefit of G_DeferedInitNew (assuming it actually needs to do ghosts = NULL;
at all)
This commit is contained in:
parent
1a14234088
commit
dd76be16cb
3 changed files with 15 additions and 9 deletions
21
src/g_demo.c
21
src/g_demo.c
|
@ -2223,6 +2223,18 @@ void G_AddGhost(char *defdemoname)
|
|||
Z_Free(pdemoname);
|
||||
}
|
||||
|
||||
// Clean up all ghosts
|
||||
void G_FreeGhosts(void)
|
||||
{
|
||||
while (ghosts)
|
||||
{
|
||||
demoghost *next = ghosts->next;
|
||||
Z_Free(ghosts);
|
||||
ghosts = next;
|
||||
}
|
||||
ghosts = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// G_TimeDemo
|
||||
// NOTE: name is a full filename for external demos
|
||||
|
@ -2389,14 +2401,7 @@ boolean G_CheckDemoStatus(void)
|
|||
{
|
||||
boolean saved;
|
||||
|
||||
while (ghosts)
|
||||
{
|
||||
demoghost *next = ghosts->next;
|
||||
Z_Free(ghosts);
|
||||
ghosts = next;
|
||||
}
|
||||
ghosts = NULL;
|
||||
|
||||
G_FreeGhosts();
|
||||
|
||||
// DO NOT end metal sonic demos here
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ void G_DeferedPlayDemo(const char *demo);
|
|||
void G_DoPlayDemo(char *defdemoname);
|
||||
void G_TimeDemo(const char *name);
|
||||
void G_AddGhost(char *defdemoname);
|
||||
void G_FreeGhosts(void);
|
||||
void G_DoPlayMetal(void);
|
||||
void G_DoneLevelLoad(void);
|
||||
void G_StopMetalDemo(void);
|
||||
|
|
|
@ -4490,7 +4490,7 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, b
|
|||
|
||||
if (demoplayback)
|
||||
COM_BufAddText("stopdemo\n");
|
||||
ghosts = NULL;
|
||||
G_FreeGhosts(); // TODO: do we actually need to do this?
|
||||
|
||||
// this leave the actual game if needed
|
||||
SV_StartSinglePlayerServer();
|
||||
|
|
Loading…
Reference in a new issue