summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2013-01-04 17:20:50 +0400
committerAndrey Nazarov <skuller@skuller.net>2013-01-05 16:08:16 +0400
commit9e008be328be5ff83457e5d0fa790f4e1f062d80 (patch)
treeaeaa10e632955b23888b6f9659b471ecbdb67fac
parent9b5a17f49083bcf89ce8465fab5e93471a846690 (diff)
Exec postexec.cfg after autoexec.cfg.
Allow postexec.cfg and postinit.cfg to be read from baseq2 when there are no such files in current gamedir.
-rw-r--r--inc/common/common.h2
-rw-r--r--src/common/common.c3
-rw-r--r--src/common/files.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/inc/common/common.h b/inc/common/common.h
index 6dd059a..58aafa7 100644
--- a/inc/common/common.h
+++ b/inc/common/common.h
@@ -36,6 +36,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define COM_DEFAULT_CFG "default.cfg"
#define COM_AUTOEXEC_CFG "autoexec.cfg"
+#define COM_POSTEXEC_CFG "postexec.cfg"
+#define COM_POSTINIT_CFG "postinit.cfg"
#ifdef _WIN32
#define COM_CONFIG_CFG "q2config.cfg"
diff --git a/src/common/common.c b/src/common/common.c
index 373fa4f..31ea3fc 100644
--- a/src/common/common.c
+++ b/src/common/common.c
@@ -977,6 +977,7 @@ void Qcommon_Init(int argc, char **argv)
Com_AddConfigFile(COM_DEFAULT_CFG, 0);
Com_AddConfigFile(COM_CONFIG_CFG, FS_TYPE_REAL | FS_PATH_GAME);
Com_AddConfigFile(COM_AUTOEXEC_CFG, FS_TYPE_REAL | FS_PATH_GAME);
+ Com_AddConfigFile(COM_POSTEXEC_CFG, FS_TYPE_REAL);
Com_AddEarlyCommands(qtrue);
@@ -1021,7 +1022,7 @@ void Qcommon_Init(int argc, char **argv)
NET_Config(NET_SERVER);
}
- Com_AddConfigFile("postinit.cfg", FS_TYPE_REAL | FS_PATH_GAME);
+ Com_AddConfigFile(COM_POSTINIT_CFG, FS_TYPE_REAL);
Com_Printf("====== " PRODUCT " initialized ======\n\n");
Com_LPrintf(PRINT_NOTICE, APPLICATION " " VERSION ", " __DATE__ "\n");
diff --git a/src/common/files.c b/src/common/files.c
index cd24632..ecb759a 100644
--- a/src/common/files.c
+++ b/src/common/files.c
@@ -3576,6 +3576,9 @@ static void fs_game_changed(cvar_t *self)
// exec autoexec.cfg (must be a real file within the game directory)
Com_AddConfigFile(COM_AUTOEXEC_CFG, FS_TYPE_REAL | FS_PATH_GAME);
+
+ // exec postexec.cfg (must be a real file)
+ Com_AddConfigFile(COM_POSTEXEC_CFG, FS_TYPE_REAL);
}
/*