summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-08-19 23:59:59 +0300
committerMikko Tiusanen <ams@daug.net>2014-08-19 23:59:59 +0300
commit7ad16ee1fea76bab54d97a78c1063b7c2c2adef6 (patch)
tree8bb1b1338a6b6b7f393623dd8e083c1754ea4b29 /src/game/g_cmds.c
parenta7ca0aa8c8a66adce30b8ac21d4849b91e4fc75b (diff)
Added layout selection support to nextmap vote.
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 77c6f82..21962ca 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1476,8 +1476,8 @@ void Cmd_CallVote_f( gentity_t *ent )
if( G_MapExists( g_nextMap.string ) )
{
trap_SendServerCommand( ent-g_entities,
- va( "print \"%s: the next map is already set to '%s'\n\"",
- cmd, g_nextMap.string ) );
+ va( "print \"%s: the next map is already set to '%s' layout '%s'\n\"",
+ cmd, g_nextMap.string, g_nextLayout.string ) );
return;
}
@@ -1489,11 +1489,27 @@ void Cmd_CallVote_f( gentity_t *ent )
return;
}
- Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
- "set g_nextMap \"%s\"", arg );
- Com_sprintf( level.voteDisplayString[ team ],
- sizeof( level.voteDisplayString[ team ] ),
- "Set the ^1next^5 map to '%s'", arg );
+ if( reason[0] )
+ {
+ if( !G_LayoutExists( arg, reason ) )
+ {
+ trap_SendServerCommand( ent-g_entities,
+ va( "print \"%s: 'layouts/%s/%s.dat' could not be found on the server\n\"",
+ cmd, arg, reason ) );
+ return;
+ }
+ Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
+ "set g_nextMap \"%s\"; set g_nextLayout \"%s\"", arg, reason );
+ Com_sprintf( level.voteDisplayString[ team ],
+ sizeof( level.voteDisplayString[ team ] ),
+ "Set the ^1next^5 map to '%s' layout '%s'", arg, reason );
+ } else {
+ Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
+ "set g_nextMap \"%s\"", arg );
+ Com_sprintf( level.voteDisplayString[ team ],
+ sizeof( level.voteDisplayString[ team ] ),
+ "Set the ^1next^5 map to '%s'", arg );
+ }
}
else if( !Q_stricmp( vote, "draw" ) )
{