summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-08-26 01:59:35 +0300
committerMikko Tiusanen <ams@daug.net>2014-08-26 01:59:35 +0300
commitf2583a18444facda582bdf1e95e4216250d8ec2a (patch)
treed3751b19f4e1ba84d6ce353b4b45e2db0b52ae9f /src
parent613030b05c409cef42b0e98d5180a41f8f67c661 (diff)
Changed next layout selection to use the existing g_layouts variable.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_cmds.c4
-rw-r--r--src/game/g_main.c23
-rw-r--r--src/game/g_maprotation.c4
3 files changed, 19 insertions, 12 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 21962ca..f865d93 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1477,7 +1477,7 @@ void Cmd_CallVote_f( gentity_t *ent )
{
trap_SendServerCommand( ent-g_entities,
va( "print \"%s: the next map is already set to '%s' layout '%s'\n\"",
- cmd, g_nextMap.string, g_nextLayout.string ) );
+ cmd, g_nextMap.string, g_layouts.string ) );
return;
}
@@ -1499,7 +1499,7 @@ void Cmd_CallVote_f( gentity_t *ent )
return;
}
Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
- "set g_nextMap \"%s\"; set g_nextLayout \"%s\"", arg, reason );
+ "set g_nextMap \"%s\";set g_layouts \"%s\"", arg, reason );
Com_sprintf( level.voteDisplayString[ team ],
sizeof( level.voteDisplayString[ team ] ),
"Set the ^1next^5 map to '%s' layout '%s'", arg, reason );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 1899f2d..3d9c52b 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -152,7 +152,6 @@ vmCvar_t g_mapRotationNodes;
vmCvar_t g_mapRotationStack;
vmCvar_t g_mapLog;
vmCvar_t g_nextMap;
-vmCvar_t g_nextLayout;
vmCvar_t g_initialMapRotation;
vmCvar_t g_debugVoices;
vmCvar_t g_voiceChats;
@@ -321,7 +320,6 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_mapRotationStack, "g_mapRotationStack", "", CVAR_ROM, 0, qfalse },
{ &g_mapLog, "g_mapLog", "", CVAR_ROM, 0, qfalse },
{ &g_nextMap, "g_nextMap", "", 0 , 0, qtrue },
- { &g_nextLayout, "g_nextLayout", "", 0, 0, qtrue },
{ &g_initialMapRotation, "g_initialMapRotation", "", CVAR_ARCHIVE, 0, qfalse },
{ &g_debugVoices, "g_debugVoices", "0", 0, 0, qfalse },
{ &g_voiceChats, "g_voiceChats", "1", CVAR_ARCHIVE, 0, qfalse },
@@ -1811,16 +1809,13 @@ void ExitLevel( void )
gclient_t *cl;
if ( G_MapExists( g_nextMap.string ) ) {
- if ( G_LayoutExists( g_nextMap.string, g_nextLayout.string ) ) {
- trap_SendConsoleCommand( EXEC_APPEND, va("map \"%s\" \"%s\"\n", g_nextMap.string, g_nextLayout.string ) );
- } else trap_SendConsoleCommand( EXEC_APPEND, va("map \"%s\"\n", g_nextMap.string ) );
+ trap_SendConsoleCommand( EXEC_APPEND, va("map \"%s\"\n", g_nextMap.string ) );
} else if( G_MapRotationActive( ) )
G_AdvanceMapRotation( 0 );
else
trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
trap_Cvar_Set( "g_nextMap", "" );
- trap_Cvar_Set( "g_nextLayout", "" );
level.restarted = qtrue;
level.changemap = NULL;
@@ -2356,13 +2351,25 @@ FUNCTIONS CALLED EVERY FRAME
========================================================================
*/
-
void G_ExecuteVote( team_t team )
{
+ char cmd[ MAX_STRING_CHARS ],*start,*current;
+
level.voteExecuteTime[ team ] = 0;
+ start = current = level.voteString[ team ];
+ while(*current) {
+ if (*current == ';') {
+ Q_strncpyz( cmd, start, current-start );
+ start = current+1;
+ trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n",
+ cmd ) );
+ }
+ ++current;
+ }
+ Q_strncpyz( cmd, start, MAX_STRING_CHARS );
trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n",
- level.voteString[ team ] ) );
+ cmd ) );
if( !Q_stricmpn( level.voteString[ team ], "map", 3 ) )
level.restarted = qtrue;
diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c
index 2de77f0..03f5c34 100644
--- a/src/game/g_maprotation.c
+++ b/src/game/g_maprotation.c
@@ -762,8 +762,8 @@ void G_PrintCurrentRotation( gentity_t *ent, const char *command )
if( g_nextMap.string[ 0 ] )
ADMBP( va( "^3the next map has been set to %s\n", g_nextMap.string ) );
- if( g_nextLayout.string[ 0 ] )
- ADMBP( va( "^3the next layout has been set to %s\n", g_nextLayout.string ) );
+ if( g_layouts.string[ 0 ] )
+ ADMBP( va( "^3the next layout has been set to %s\n", g_layouts.string ) );
ADMBP_end( );
}