summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2006-09-14 21:19:06 +0000
committerTony J. White <tjw@tjw.org>2006-09-14 21:19:06 +0000
commita92ed49c40ee36c47e6fc5ab3d1e0b9f0a9ecd68 (patch)
tree3c7558ebaf0706cb53e092cbd5dd6602127ddde4 /src/game/g_main.c
parentf2c804e3c66f48ad90eff3908c44a58681e107d5 (diff)
* (bug 2666) G_MapConfigs() would try to execute the .cfg for the map that was
finishing instead of the one that was loading when invoked from the maprotation system.
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 2d2a1427..c10b547f 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -463,9 +463,8 @@ void G_UpdateCvars( void )
G_MapConfigs
=================
*/
-void G_MapConfigs( )
+void G_MapConfigs( const char *mapname )
{
- char map[MAX_QPATH] = {""};
if( !g_mapConfigs.string[0] )
return;
@@ -475,10 +474,9 @@ void G_MapConfigs( )
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 ) );
+ va( "exec \"%s/%s.cfg\"\n", g_mapConfigs.string, mapname ) );
trap_Cvar_Set( "g_mapConfigsLoaded", "1" );
}
@@ -536,7 +534,13 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
else
G_Printf( "Not logging to disk\n" );
- G_MapConfigs( );
+ {
+ char map[ MAX_CVAR_VALUE_STRING ] = {""};
+
+ trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) );
+ G_MapConfigs( map );
+ }
+
// we're done with g_mapConfigs, so reset this for the next map
trap_Cvar_Set( "g_mapConfigsLoaded", "0" );