Fix some G_BuildMapName string formats

more like "flex xva" but ok
This commit is contained in:
GenericHeroGuy 2025-02-17 21:44:23 +01:00
parent 723164152f
commit 8d3083cefe
3 changed files with 9 additions and 18 deletions

View file

@ -581,6 +581,7 @@ static void G_UpdateRecordReplays(void)
char *gpath;
char lastdemo[256], bestdemo[256];
UINT8 earnedEmblems;
int parts;
// Record new best time
if (!mapheaderinfo[gamemap-1]->mainrecord)
@ -613,17 +614,13 @@ static void G_UpdateRecordReplays(void)
G_SetDemoTime(players[consoleplayer].realtime, bestlap);
G_CheckDemoStatus();
gpath = va("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s",
srb2home, timeattackfolder);
M_MkdirEach(gpath, M_PathParts(gpath) - 3, 0755);
strcat(gpath, PATHSEP);
strcat(gpath, G_BuildMapName(gamemap));
gpath = xva("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s",
srb2home, timeattackfolder, G_BuildMapName(gamemap));
parts = M_PathParts(gpath);
M_MkdirEachUntil(gpath, parts - 4, parts - 1, 0755);
snprintf(lastdemo, 255, "%s-%s-last.lmp", gpath, cv_chooseskin.string);
gpath = Z_StrDup(gpath);
if (FIL_FileExists(lastdemo))
{
UINT8 *buf;
@ -655,7 +652,7 @@ static void G_UpdateRecordReplays(void)
Z_Free(buf);
}
Z_Free(gpath);
free(gpath);
// Check emblems when level data is updated
if ((earnedEmblems = M_CheckLevelEmblems()))

View file

@ -2165,16 +2165,10 @@ void Nextmap_OnChange(void)
{
// see also p_setup.c's P_LoadRecordGhosts
const char *gamemode = (levellistmode == LLM_ITEMBREAKER) ? "IB" : "RA";
const size_t glen = strlen(srb2home)+1+strlen("media")+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1;
char *gpath = malloc(glen);
char *gpath = xva("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value));
INT32 i;
UINT8 active = 0;
if (!gpath)
return;
sprintf(gpath,"%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value));
CV_StealthSetValue(&cv_dummystaff, 0);
active = 0;

View file

@ -7795,7 +7795,7 @@ static void P_LoadRecordGhosts(void)
INT32 i;
const char *gamemode = (modeattacking & ATTACKING_ITEMBREAK) ? "IB" : "RA";
gpath = Z_StrDup(va("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)));
gpath = xva("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap));
// Best Time ghost
if (cv_ghost_besttime.value)
@ -7856,7 +7856,7 @@ static void P_LoadRecordGhosts(void)
}
}
Z_Free(gpath);
free(gpath);
}
static void P_SetupCamera(UINT8 pnum, camera_t *cam)