diff options
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 3df9adab..16e2ecd1 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1170,6 +1170,7 @@ void Cmd_CallVote_f( gentity_t *ent ) int clientNum = -1; int id = -1; team_t team; + vote_t *v; trap_Argv( 0, cmd, sizeof( cmd ) ); trap_Argv( 1, vote, sizeof( vote ) ); @@ -1181,6 +1182,7 @@ void Cmd_CallVote_f( gentity_t *ent ) team = ent->client->pers.teamSelection; else team = TEAM_NONE; + v = &level.votes[ team ]; if( !g_allowVote.integer ) { @@ -1340,12 +1342,15 @@ void Cmd_CallVote_f( gentity_t *ent ) } else if( !Q_stricmp( vote, "map_restart" ) ) { - strcpy( level.voteString[ team ], vote ); + v->cons = VC_RESTART; + strcpy( level.voteString[ team ], "restart" ); strcpy( level.voteDisplayString[ team ], "Restart current map" ); // map_restart comes with a default delay } else if( !Q_stricmp( vote, "map" ) ) { + mapVotePms_t *p = &v->pms.map; + if( !G_MapExists( arg ) ) { trap_SendServerCommand( ent-g_entities, @@ -1354,8 +1359,10 @@ void Cmd_CallVote_f( gentity_t *ent ) return; } + v->cons = VC_MAP; + p->map = G_CopyString( arg ); Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ), - "%s \"%s\"", vote, arg ); + "map: %s", arg ); Com_sprintf( level.voteDisplayString[ team ], sizeof( level.voteDisplayString[ team ] ), "Change to map '%s'", arg ); @@ -1363,6 +1370,8 @@ void Cmd_CallVote_f( gentity_t *ent ) } else if( !Q_stricmp( vote, "nextmap" ) ) { + mapVotePms_t *p = &v->pms.map; + if( G_MapExists( g_nextMap.string ) ) { trap_SendServerCommand( ent-g_entities, @@ -1379,8 +1388,10 @@ void Cmd_CallVote_f( gentity_t *ent ) return; } + v->cons = VC_NEXTMAP; + p->map = G_CopyString( arg ); Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ), - "set g_nextMap \"%s\"", arg ); + "nextmap: %s", arg ); Com_sprintf( level.voteDisplayString[ team ], sizeof( level.voteDisplayString[ team ] ), "Set the next map to '%s'", arg ); |