mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
use a private cbuf for map_cfg
This commit is contained in:
parent
c9346e806c
commit
70ec073904
1 changed files with 7 additions and 4 deletions
|
@ -51,6 +51,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
#include "QF/hash.h"
|
#include "QF/hash.h"
|
||||||
|
#include "QF/idparse.h"
|
||||||
#include "QF/msg.h"
|
#include "QF/msg.h"
|
||||||
#include "QF/quakeio.h"
|
#include "QF/quakeio.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
|
@ -258,21 +259,23 @@ map_cfg (const char *mapname, int all)
|
||||||
{
|
{
|
||||||
char *name = malloc (strlen (mapname) + 4 + 1);
|
char *name = malloc (strlen (mapname) + 4 + 1);
|
||||||
QFile *f;
|
QFile *f;
|
||||||
|
cbuf_t *cbuf = Cbuf_New (&id_interp);
|
||||||
|
|
||||||
QFS_StripExtension (mapname, name);
|
QFS_StripExtension (mapname, name);
|
||||||
strcat (name, ".cfg");
|
strcat (name, ".cfg");
|
||||||
QFS_FOpenFile (name, &f);
|
QFS_FOpenFile (name, &f);
|
||||||
if (f) {
|
if (f) {
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
Cmd_Exec_File (cl_cbuf, name, 1);
|
Cmd_Exec_File (cbuf, name, 1);
|
||||||
} else {
|
} else {
|
||||||
Cmd_Exec_File (cl_cbuf, "maps_default.cfg", 1);
|
Cmd_Exec_File (cbuf, "maps_default.cfg", 1);
|
||||||
}
|
}
|
||||||
if (all)
|
if (all)
|
||||||
Cbuf_Execute_Stack (cl_cbuf);
|
Cbuf_Execute_Stack (cbuf);
|
||||||
else
|
else
|
||||||
Cbuf_Execute_Sets (cl_cbuf);
|
Cbuf_Execute_Sets (cbuf);
|
||||||
free (name);
|
free (name);
|
||||||
|
Cbuf_Delete(cbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue