mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
Merge branch 'buildtitle-memory-leak' into 'master'
Consistently free G_BuildMapTitle See merge request KartKrew/Kart-Public!323
This commit is contained in:
commit
fcddbdeaa1
3 changed files with 37 additions and 7 deletions
|
@ -529,8 +529,10 @@ void DRPC_UpdatePresence(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Map name on tool tip
|
// Map name on tool tip
|
||||||
snprintf(mapname, 48, "Map: %s", G_BuildMapTitle(gamemap));
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
|
snprintf(mapname, 48, "Map: %s", title);
|
||||||
discordPresence.largeImageText = mapname;
|
discordPresence.largeImageText = mapname;
|
||||||
|
Z_Free(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gamestate == GS_LEVEL && Playing())
|
if (gamestate == GS_LEVEL && Playing())
|
||||||
|
|
|
@ -6745,7 +6745,11 @@ void G_BeginRecording(void)
|
||||||
|
|
||||||
// Full replay title
|
// Full replay title
|
||||||
demo_p += 64;
|
demo_p += 64;
|
||||||
snprintf(demo.titlename, 64, "%s - %s", G_BuildMapTitle(gamemap), modeattacking ? "Time Attack" : connectedservername);
|
{
|
||||||
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
|
snprintf(demo.titlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
|
||||||
|
Z_Free(title);
|
||||||
|
}
|
||||||
|
|
||||||
// demo checksum
|
// demo checksum
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
34
src/m_menu.c
34
src/m_menu.c
|
@ -5577,7 +5577,11 @@ static void DrawReplayHutReplayInfo(void)
|
||||||
x += 85;
|
x += 85;
|
||||||
|
|
||||||
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
||||||
V_DrawString(x, y, V_SNAPTOTOP, G_BuildMapTitle(demolist[dir_on[menudepthleft]].map));
|
{
|
||||||
|
char *title = G_BuildMapTitle(demolist[dir_on[menudepthleft]].map);
|
||||||
|
V_DrawString(x, y, V_SNAPTOTOP, title);
|
||||||
|
Z_Free(title);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
||||||
|
|
||||||
|
@ -6513,16 +6517,36 @@ static char *M_GetConditionString(condition_t cond)
|
||||||
G_TicsToMinutes(cond.requirement, false),
|
G_TicsToMinutes(cond.requirement, false),
|
||||||
G_TicsToSeconds(cond.requirement));
|
G_TicsToSeconds(cond.requirement));
|
||||||
case UC_MAPVISITED:
|
case UC_MAPVISITED:
|
||||||
return va("Visit %s", G_BuildMapTitle(cond.requirement-1));
|
{
|
||||||
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
|
char *response = va("Visit %s", title);
|
||||||
|
Z_Free(title);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
case UC_MAPBEATEN:
|
case UC_MAPBEATEN:
|
||||||
return va("Beat %s", G_BuildMapTitle(cond.requirement-1));
|
{
|
||||||
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
|
char *response = va("Beat %s", title);
|
||||||
|
Z_Free(title);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
case UC_MAPALLEMERALDS:
|
case UC_MAPALLEMERALDS:
|
||||||
return va("Beat %s w/ all emeralds", G_BuildMapTitle(cond.requirement-1));
|
{
|
||||||
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
|
char *response = va("Beat %s w/ all emeralds", title);
|
||||||
|
Z_Free(title);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
case UC_MAPTIME:
|
case UC_MAPTIME:
|
||||||
return va("Beat %s in %i:%02i.%02i", G_BuildMapTitle(cond.extrainfo1-1),
|
{
|
||||||
|
char *title = G_BuildMapTitle(cond.extrainfo1-1);
|
||||||
|
char *response = va("Beat %s in %i:%02i.%02i", title,
|
||||||
G_TicsToMinutes(cond.requirement, true),
|
G_TicsToMinutes(cond.requirement, true),
|
||||||
G_TicsToSeconds(cond.requirement),
|
G_TicsToSeconds(cond.requirement),
|
||||||
G_TicsToCentiseconds(cond.requirement));
|
G_TicsToCentiseconds(cond.requirement));
|
||||||
|
Z_Free(title);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
case UC_TOTALEMBLEMS:
|
case UC_TOTALEMBLEMS:
|
||||||
return va("Get %d medals", cond.requirement);
|
return va("Get %d medals", cond.requirement);
|
||||||
case UC_EXTRAEMBLEM:
|
case UC_EXTRAEMBLEM:
|
||||||
|
|
Loading…
Reference in a new issue