From b55b17ccee7c2056e3ea0d09e633c141a301c052 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 4 Nov 2023 23:34:07 +0000 Subject: [PATCH] G_FindMap: Support menuttl as well Permits "map brakes" and "map balconies" Secretly just uses the titlecard map name behind the scenes, but the author of this commit didn't want to be too intrusive. --- src/g_game.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 203908c92..9fa2a2b1d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5982,7 +5982,9 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep, aprop = realmapname; /* Now that we found a perfect match no need to fucking guess. */ - if (strnicmp(realmapname, mapname, mapnamelen) == 0) + if (strnicmp(realmapname, mapname, mapnamelen) == 0 + || (mapheaderinfo[i]->menuttl[0] + && strnicmp(mapheaderinfo[i]->menuttl, mapname, mapnamelen) == 0)) { if (wanttable) { @@ -6016,15 +6018,42 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep, realmapname = 0; } } + else + if (mapheaderinfo[i]->menuttl[0] && ( aprop = strcasestr(mapheaderinfo[i]->menuttl, mapname) )) + { + if (wanttable) + { + writesimplefreq(freq, &freqc, + mapnum, aprop - mapheaderinfo[i]->menuttl, mapnamelen); + } + if (apromapnum == 0) + { + apromapnum = mapnum; + apromapname = realmapname; + realmapname = 0; + } + } else/* ...match individual keywords */ { freq[freqc].mapnum = mapnum; measurekeywords(&freq[freqc], &freq[freqc].matchd, &freq[freqc].matchc, realmapname, mapname, wanttable); - measurekeywords(&freq[freqc], - &freq[freqc].keywhd, &freq[freqc].keywhc, - mapheaderinfo[i]->keywords, mapname, wanttable); + + if (mapheaderinfo[i]->menuttl[0]) + { + measurekeywords(&freq[freqc], + &freq[freqc].keywhd, &freq[freqc].keywhc, + mapheaderinfo[i]->menuttl, mapname, wanttable); + } + + if (mapheaderinfo[i]->keywords[0]) + { + measurekeywords(&freq[freqc], + &freq[freqc].keywhd, &freq[freqc].keywhc, + mapheaderinfo[i]->keywords, mapname, wanttable); + } + if (freq[freqc].total) freqc++; }