diff options
author | Mikko Tiusanen <ams@daug.net> | 2014-08-19 21:47:12 +0300 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2014-08-19 21:47:12 +0300 |
commit | a7ca0aa8c8a66adce30b8ac21d4849b91e4fc75b (patch) | |
tree | 03f08069aaae71ce18dcfd08e32892dd5573977e /src/game/g_cmds.c | |
parent | 5618f2bb4b91f4942d6936fdd18b42e354feee9c (diff) |
Added support for selecting layout with map vote.
Removed outdated comments and moved trapper accuracy to tremulous header.
Disabled map votes during first minute even when there's only one player connected.
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f876553..77c6f82 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1426,8 +1426,7 @@ void Cmd_CallVote_f( gentity_t *ent ) } else if( !Q_stricmp( vote, "map" ) ) { - if( (( level.time - level.startTime ) < 60 * 1000 ) - && ( level.numPlayingClients > 0 && level.numConnectedClients > 1 ) ) + if( (( level.time - level.startTime ) < 60 * 1000 ) ) { trap_SendServerCommand( ent-g_entities, "print \"You cannot call for a map change in the first minute.\n\"" ); return; @@ -1449,11 +1448,27 @@ void Cmd_CallVote_f( gentity_t *ent ) return; } - Com_sprintf( level.voteString[ team ], sizeof( level.voteString ), - "%s \"%s\"", vote, arg ); - Com_sprintf( level.voteDisplayString[ team ], - sizeof( level.voteDisplayString[ team ] ), - "Change to map '%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 ), + "%s \"%s\" \"%s\"", vote, arg, reason ); + Com_sprintf( level.voteDisplayString[ team ], + sizeof( level.voteDisplayString[ team ] ), + "Change to map '%s' (layout: '%s')", arg, reason ); + } else { + Com_sprintf( level.voteString[ team ], sizeof( level.voteString ), + "%s \"%s\"", vote, arg ); + Com_sprintf( level.voteDisplayString[ team ], + sizeof( level.voteDisplayString[ team ] ), + "Change to map '%s'", arg ); + } level.voteDelay[ team ] = 3000; } else if( !Q_stricmp( vote, "nextmap" ) ) |