Revert "add global maptitle string calced at mapload"

This reverts commit 401597d309.
This commit is contained in:
Alug committed 2024-10-02 12:42:04 +02:00
1 parent 0ecc23e52d
commit 7b62c14a8e
6 files changed
+20 -15

No files matched your search

+1 -1
View File
@@ -3141,7 +3141,7 @@ static void Command_ReplayMarker(void)
demo.savemode = DSM_WILLAUTOSAVE;
if (adjustedleveltime < 0)
adjustedleveltime = 0;
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", maptitle, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", G_BuildMapTitle(gamemap), G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
CONS_Printf("Replay will be saved!\n");
}
}
+3 -1
View File
@@ -570,8 +570,10 @@ void DRPC_UpdatePresence(void)
else
{
// Map name on tool tip
snprintf(mapname, 48, "Map: %s", maptitle);
char *title = G_BuildMapTitle(gamemap);
snprintf(mapname, 48, "Map: %s", title);
discordPresence.largeImageText = mapname;
Z_Free(title);
}
if (gamestate == GS_LEVEL && Playing())
-1
View File
@@ -31,7 +31,6 @@
// Selected by user.
extern INT16 gamemap;
extern char *maptitle;
extern char mapmusname[7];
extern UINT16 mapmusflags;
extern UINT32 mapmusposition;
+13 -9
View File
@@ -91,7 +91,6 @@ UINT32 mapmusposition; // Position to jump to
UINT32 mapmusresume;
INT16 gamemap = 1;
char *maptitle = {0};
INT16 maptol;
UINT8 globalweather = 0;
INT32 curWeather = PRECIP_NONE;
@@ -4249,10 +4248,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
gamemap = (INT16)M_MapNumber(mapname[3], mapname[4]); // get xx out of MAPxx
if (maptitle)
Z_Free(maptitle);
maptitle = G_BuildMapTitle(gamemap);
// gamemap changed; we assume that its map header is always valid,
// so make it so
if(!mapheaderinfo[gamemap-1])
@@ -4278,9 +4273,14 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
if (netgame)
{
char *title = G_BuildMapTitle(gamemap);
CON_LogMessage(va(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap)));
if (maptitle)
CON_LogMessage(va(": %s", maptitle));
if (title)
{
CON_LogMessage(va(": %s", title));
Z_Free(title);
}
CON_LogMessage("\"\n");
}
}
@@ -4429,7 +4429,8 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
break;
}
}
else if (apromapnum == 0 || wanttable)
else
if (apromapnum == 0 || wanttable)
{
/* LEVEL 1--match keywords verbatim */
if (( aprop = strcasestr(realmapname, mapname) ))
@@ -6261,7 +6262,7 @@ void G_BeginRecording(void)
demoflags |= DF_ENCORE;
if (!modeattacking && gL) // Ghosts don't read luavars, and you shouldn't ever need to save Lua in replays, you doof!
// SERIOUSLY THOUGH WHY WOULD YOU LOAD HOSTMOD AND RECORD A GHOST WITH IT !????
// SERIOUSLY THOUGH WHY WOULD YOU LOAD HOSTMOD AND RECORD A GHOST WITH IT !????
demoflags |= DF_LUAVARS;
// Setup header.
@@ -6283,6 +6284,9 @@ void G_BeginRecording(void)
// This will indirectly assign to demo.titlename too
M_TextInputSetString(&demo.titlenameinput, demotitlename);
char *title = G_BuildMapTitle(gamemap);
snprintf(demo.titlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
Z_Free(title);
}
// demo checksum
+2 -2
View File
@@ -2630,10 +2630,10 @@ static void HU_DrawRankings(void)
//V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, gametype_cons_t[gametype].strvalue);
// draw the current map in the lower right if theres none just say its unknown
if (!maptitle)
if (!G_BuildMapTitle(gamemap))
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "UNKNOWN");
else
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, maptitle);
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, G_BuildMapTitle(gamemap));
if (!G_RaceGametype())
{
+1 -1
View File
@@ -2041,7 +2041,7 @@ void S_CheckMap(void)
//
void S_InitMapMusic(void)
{
skipintromus = cv_skipintromusic.value && stricmp(maptitle, "Wandering Falls") != 0; // thanks diggle!
skipintromus = cv_skipintromusic.value && stricmp(G_BuildMapTitle(gamemap), "Wandering Falls") != 0; // thanks diggle!
if (mapmusflags & MUSIC_RELOADRESET)
{