summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 8dede827..c077a3b6 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1215,7 +1215,7 @@ void Cmd_CallVote_f( gentity_t *ent )
}
else if( !Q_stricmp( arg1, "map" ) )
{
- if( !trap_FS_FOpenFile( va( "maps/%s.bsp", arg2 ), NULL, FS_READ ) )
+ if( !G_MapExists( arg2 ) )
{
trap_SendServerCommand( ent - g_entities, va( "print \"callvote: "
"'maps/%s.bsp' could not be found on the server\n\"", arg2 ) );
@@ -1226,6 +1226,28 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteDisplayString,
sizeof( level.voteDisplayString ), "Change to map '%s'", arg2 );
}
+ else if( !Q_stricmp( arg1, "nextmap" ) )
+ {
+ if( G_MapExists( g_nextMap.string ) )
+ {
+ trap_SendServerCommand( ent - g_entities, va( "print \"callvote: "
+ "the next map is already set to '%s^7'\n\"", g_nextMap.string ) );
+ return;
+ }
+
+ if( !G_MapExists( arg2 ) )
+ {
+ trap_SendServerCommand( ent - g_entities, va( "print \"callvote: "
+ "'maps/%s^7.bsp' could not be found on the server\n\"", arg2 ) );
+ return;
+ }
+
+ Com_sprintf( level.voteString, sizeof( level.voteString ),
+ "set g_nextMap %s", arg2 );
+
+ Com_sprintf( level.voteDisplayString,
+ sizeof( level.voteDisplayString ), "Set the next map to '%s^7'", arg2 );
+ }
else if( !Q_stricmp( arg1, "draw" ) )
{
Com_sprintf( level.voteString, sizeof( level.voteString ), "evacuation" );
@@ -1270,7 +1292,7 @@ void Cmd_CallVote_f( gentity_t *ent )
{
trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"Valid vote commands are: "
- "map, map_restart, sudden_death, draw, kick, mute and unmute\n" );
+ "map, nextmap, map_restart, sudden_death, draw, kick, mute and unmute\n" );
return;
}