From d45889800fbd11eadca421703e3e6d7372dfcb18 Mon Sep 17 00:00:00 2001 From: Eukara Date: Wed, 1 Apr 2020 09:27:04 +0000 Subject: [PATCH] Manifest cvars can now be queried via getgameinfo. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5665 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_clcmd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engine/client/pr_clcmd.c b/engine/client/pr_clcmd.c index c798fc2ee..50f85a92d 100644 --- a/engine/client/pr_clcmd.c +++ b/engine/client/pr_clcmd.c @@ -1093,7 +1093,7 @@ static struct modlist_s static size_t nummods; static qboolean modsinited; -/*static qboolean Mods_AddManifest(void *usr, ftemanifest_t *man) +static qboolean Mods_AddManifest(void *usr, ftemanifest_t *man) { int i = nummods; modlist = BZ_Realloc(modlist, (i+1) * sizeof(*modlist)); @@ -1102,7 +1102,7 @@ static qboolean modsinited; modlist[i].description = man->formalname; nummods = i+1; return true; -}*/ +} static int QDECL Mods_AddGamedir(const char *fname, qofs_t fsize, time_t mtime, void *usr, searchpathfuncs_t *spath) { char *f; @@ -1148,7 +1148,7 @@ static void Mods_InitModList (void) { extern qboolean com_homepathenabled; - //FS_EnumerateKnownGames(Mods_AddManifest, NULL); + FS_EnumerateKnownGames(Mods_AddManifest, NULL); if (com_homepathenabled) Sys_EnumerateFiles(com_homepath, "*", Mods_AddGamedir, com_homepath, NULL); @@ -1175,6 +1175,11 @@ void QCBUILTIN PF_cl_getgamedirinfo(pubprogfuncs_t *prinst, struct globalvars_s if (modlist[diridx].description) RETURN_TSTRING(modlist[diridx].description); break; + case 2: //cvars + if (modlist[diridx].manifest) + if (modlist[diridx].manifest->defaultexec) + RETURN_TSTRING(modlist[diridx].manifest->defaultexec); + break; case 0: //name RETURN_TSTRING(modlist[diridx].gamedir); break;