-Added the cvar sv_progs, which allows you to set the name of the server
[xonotic/darkplaces.git] / pr_edict.c
index 62688275ad08d60e94774ae820caf11d3c469dc3..2ea21f97ffde0ba94e64756c11d6b2d90e3174cd 100644 (file)
@@ -1289,13 +1289,16 @@ PR_LoadProgs
 ===============
 */
 extern void PR_Cmd_Reset (void);
-void PR_LoadProgs (void)
+void PR_LoadProgs (const char *progsname)
 {
        int i;
        dstatement_t *st;
        ddef_t *infielddefs;
        dfunction_t *dfunctions;
 
+       if (!progsname || !*progsname) 
+               Host_Error("PR_LoadProgs: passed empty progsname");
+
 // flush the non-C variable lookup cache
        for (i=0 ; i<GEFV_CACHESIZE ; i++)
                gefvCache[i].field[0] = 0;
@@ -1303,9 +1306,9 @@ void PR_LoadProgs (void)
        Mem_EmptyPool(progs_mempool);
        Mem_EmptyPool(edictstring_mempool);
 
-       progs = (dprograms_t *)FS_LoadFile ("progs.dat", progs_mempool, false);
+       progs = (dprograms_t *)FS_LoadFile (progsname, progs_mempool, false);
        if (!progs)
-               Host_Error ("PR_LoadProgs: couldn't load progs.dat");
+               Host_Error ("PR_LoadProgs: couldn't load %s", progsname);
 
        Con_DPrintf("Programs occupy %iK.\n", fs_filesize/1024);