Remove "exec autoexec.cfg" on gamedir change; add checking that frontend.cfg exists before trying to execute it

This commit is contained in:
Anton E. Gavrilov 2000-05-03 09:28:33 +00:00
parent a05d712277
commit 71af74200b

View file

@ -577,12 +577,17 @@ void CL_ParseServerData (void)
//if it exists
if (cflag) {
snprintf(fn, sizeof(fn), "%s/%s", com_gamedir, "config.cfg");
if ((f = Qopen(fn, "rz")) != NULL) {
if ((f = Qopen(fn, "r")) != NULL) {
Qclose(f);
Cbuf_AddText ("cl_warncmd 0\n");
Cbuf_AddText("exec config.cfg\n");
Cbuf_AddText("exec frontend.cfg\n");
Cbuf_AddText("exec autoexec.cfg\n");
Cbuf_AddText ("exec config.cfg\n");
Cbuf_AddText ("cl_warncmd 1\n");
}
snprintf(fn, sizeof(fn), "%s/%s", com_gamedir, "frontend.cfg");
if ((f = Qopen(fn, "r")) != NULL) {
Qclose(f);
Cbuf_AddText ("cl_warncmd 0\n");
Cbuf_AddText ("exec frontend.cfg\n");
Cbuf_AddText ("cl_warncmd 1\n");
}
}