diff options
author | M. Kristall <mkpdev@gmail.com> | 2007-06-29 13:01:08 +0000 |
---|---|---|
committer | M. Kristall <mkpdev@gmail.com> | 2007-06-29 13:01:08 +0000 |
commit | dbfc4f5a76835c83ba4ad22de066ba31826543ca (patch) | |
tree | dd1dbcfb60722bb95fb5b48a6fe718b5ce51b386 /src/game | |
parent | bbaa283ea6528b2934d45967550d8c2ea7a9c775 (diff) |
* check if a target was specified for votes that require one (was choosing the
player at slot 0)
* remove some unnecessary code
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_cmds.c | 18 | ||||
-rw-r--r-- | src/game/g_main.c | 3 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f4eeeb8e..7b0751c0 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1050,7 +1050,14 @@ void Cmd_CallVote_f( gentity_t *ent ) !Q_stricmp( arg1, "unmute" ) ) { int clientNums[ MAX_CLIENTS ] = { -1 }; - + + if( !arg2[ 0 ] ) + { + trap_SendServerCommand( ent-g_entities, + "print \"callvote: no target\n\"" ); + return; + } + if( G_ClientNumbersFromString( arg2, clientNums ) == 1 ) { // there was only one partial name match @@ -1283,7 +1290,14 @@ void Cmd_CallTeamVote_f( gentity_t *ent ) !Q_stricmp( arg1, "allowbuild" ) ) { int clientNums[ MAX_CLIENTS ] = { -1 }; - + + if( !arg2[ 0 ] ) + { + trap_SendServerCommand( ent-g_entities, + "print \"callvote: no target\n\"" ); + return; + } + if( G_ClientNumbersFromString( arg2, clientNums ) == 1 ) { // there was only one partial name match diff --git a/src/game/g_main.c b/src/game/g_main.c index 9f756c61..1ddee7eb 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1290,9 +1290,6 @@ void CalculateRanks( void ) level.numLiveAlienClients = 0; level.numLiveHumanClients = 0; - for( i = 0; i < TEAM_NUM_TEAMS; i++ ) - level.numteamVotingClients[ i ] = 0; - for( i = 0; i < level.maxclients; i++ ) { P[ i ] = '-'; |