From dbfc4f5a76835c83ba4ad22de066ba31826543ca Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Fri, 29 Jun 2007 13:01:08 +0000 Subject: * check if a target was specified for votes that require one (was choosing the player at slot 0) * remove some unnecessary code --- src/game/g_cmds.c | 18 ++++++++++++++++-- src/game/g_main.c | 3 --- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src') 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 ] = '-'; -- cgit