summaryrefslogtreecommitdiff
path: root/src/game/g_maprotation.c
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2006-12-29 23:31:57 +0000
committerTony J. White <tjw@tjw.org>2006-12-29 23:31:57 +0000
commitefbd4de85142909a5e5d30ed7812666f095c68cd (patch)
treeff03916b937a50d9731415624301424619f98e94 /src/game/g_maprotation.c
parent717589aa42f483cf962b5a7bb55498108dc5c35a (diff)
* (bug 2973) support for multiple initial base layouts ( Risujin, vcxzet, tjw )
Diffstat (limited to 'src/game/g_maprotation.c')
-rw-r--r--src/game/g_maprotation.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c
index ad4e5cf4..c3a8d8a6 100644
--- a/src/game/g_maprotation.c
+++ b/src/game/g_maprotation.c
@@ -52,6 +52,19 @@ static qboolean G_ParseMapCommandSection( mapRotationEntry_t *mre, char **text_p
if( !Q_stricmp( token, "}" ) )
return qtrue; //reached the end of this command section
+ if( !Q_stricmp( token, "layouts" ) )
+ {
+ token = COM_ParseExt( text_p, qfalse );
+ mre->layouts[ 0 ] = '\0';
+ while( token && token[ 0 ] != 0 )
+ {
+ Q_strcat( mre->layouts, sizeof( mre->layouts ), token );
+ Q_strcat( mre->layouts, sizeof( mre->layouts ), " " );
+ token = COM_ParseExt( text_p, qfalse );
+ }
+ continue;
+ }
+
Q_strncpyz( mre->postCmds[ mre->numCmds ], token, sizeof( mre->postCmds[ 0 ] ) );
Q_strcat( mre->postCmds[ mre->numCmds ], sizeof( mre->postCmds[ 0 ] ), " " );
@@ -476,6 +489,14 @@ static void G_IssueMapChange( int rotation )
int map = G_GetCurrentMap( rotation );
char cmd[ MAX_TOKEN_CHARS ];
+ // allow a manually defined g_layouts setting to override the maprotation
+ if( !g_layouts.string[ 0 ] &&
+ mapRotations.rotations[ rotation ].maps[ map ].layouts[ 0 ] )
+ {
+ trap_Cvar_Set( "g_layouts",
+ mapRotations.rotations[ rotation ].maps[ map ].layouts );
+ }
+
trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n",
mapRotations.rotations[ rotation ].maps[ map ].name ) );