Index: src/game/g_local.h =================================================================== --- src/game/g_local.h (revision 765) +++ src/game/g_local.h (working copy) @@ -1076,6 +1076,8 @@ extern vmCvar_t g_currentMap; extern vmCvar_t g_initialMapRotation; +extern vmCvar_t g_mapConfigs; + void trap_Printf( const char *fmt ); void trap_Error( const char *fmt ); int trap_Milliseconds( void ); Index: src/game/g_main.c =================================================================== --- src/game/g_main.c (revision 765) +++ src/game/g_main.c (working copy) @@ -107,6 +107,8 @@ vmCvar_t g_currentMap; vmCvar_t g_initialMapRotation; +vmCvar_t g_mapConfigs; + static cvarTable_t gameCvarTable[ ] = { // don't override the cheat state set by the system @@ -195,6 +197,7 @@ { &g_currentMapRotation, "g_currentMapRotation", "-1", 0, 0, qfalse }, // -1 = NOT_ROTATING { &g_currentMap, "g_currentMap", "0", 0, 0, qfalse }, { &g_initialMapRotation, "g_initialMapRotation", "", CVAR_ARCHIVE, 0, qfalse }, + { &g_mapConfigs, "g_mapConfigs", "", CVAR_ARCHIVE, 0, qfalse }, { &g_rankings, "g_rankings", "0", 0, 0, qfalse} }; @@ -481,6 +484,18 @@ else G_Printf( "Not logging to disk\n" ); + if( g_mapConfigs.string[0] ) + { + char map[MAX_QPATH] = {""}; + + trap_SendConsoleCommand( EXEC_APPEND, + va( "exec \"%s/default.cfg\"\n", g_mapConfigs.string ) ); + + trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) ); + trap_SendConsoleCommand( EXEC_APPEND, + va( "exec \"%s/%s.cfg\"\n", g_mapConfigs.string, map ) ); + } + // initialize all entities for this game memset( g_entities, 0, MAX_GENTITIES * sizeof( g_entities[ 0 ] ) ); level.gentities = g_entities;