Index: src/game/g_cmds.c =================================================================== --- src/game/g_cmds.c (revision 933) +++ src/game/g_cmds.c (working copy) @@ -1074,17 +1074,16 @@ sizeof( name ) ); Q_CleanStr( name ); } - } - - if( !Q_stricmp( arg1, "kick" ) ) - { - if( clientNum == -1 ) + else { trap_SendServerCommand( ent-g_entities, "print \"callvote: invalid player\n\"" ); return; } - + } + + if( !Q_stricmp( arg1, "kick" ) ) + { if( G_admin_permission( &g_entities[ clientNum ], ADMF_IMMUNITY ) ) { trap_SendServerCommand( ent-g_entities, @@ -1101,14 +1100,6 @@ } else if( !Q_stricmp( arg1, "mute" ) ) { - - if( clientNum == -1 ) - { - trap_SendServerCommand( ent-g_entities, - "print \"callvote: invalid player\n\"" ); - return; - } - if( level.clients[ clientNum ].pers.muted ) { trap_SendServerCommand( ent-g_entities, @@ -1129,13 +1120,6 @@ } else if( !Q_stricmp( arg1, "unmute" ) ) { - - if( clientNum == -1 ) - { - trap_SendServerCommand( ent-g_entities, - "print \"callvote: invalid player\n\"" ); - return; - } if( !level.clients[ clientNum ].pers.muted ) { trap_SendServerCommand( ent-g_entities, @@ -1258,19 +1242,16 @@ team = ent->client->pers.teamSelection; - if( team == PTE_NONE ) - { - trap_SendServerCommand( ent-g_entities, - "print \"Not allowed to call a team vote as a spectator\n\"" ); - return; - } - if( team == PTE_HUMANS ) cs_offset = 0; else if( team == PTE_ALIENS ) cs_offset = 1; else + { + trap_SendServerCommand( ent-g_entities, + "print \"Not allowed to call a team vote as a spectator\n\"" ); return; + } if( !g_allowVote.integer ) { @@ -1341,17 +1322,16 @@ sizeof( name ) ); Q_CleanStr( name ); } - } - - if( !Q_stricmp( arg1, "kick" ) ) - { - if( clientNum == -1 ) + else { trap_SendServerCommand( ent-g_entities, "print \"callteamvote: invalid player\n\"" ); return; } + } + if( !Q_stricmp( arg1, "kick" ) ) + { if( G_admin_permission( &g_entities[ clientNum ], ADMF_IMMUNITY ) ) { trap_SendServerCommand( ent-g_entities, @@ -1371,13 +1351,6 @@ } else if( !Q_stricmp( arg1, "denybuild" ) ) { - if( clientNum == -1 ) - { - trap_SendServerCommand( ent-g_entities, - "print \"callteamvote: invalid player\n\"" ); - return; - } - if( level.clients[ clientNum ].pers.denyBuild ) { trap_SendServerCommand( ent-g_entities, @@ -1400,13 +1373,6 @@ } else if( !Q_stricmp( arg1, "allowbuild" ) ) { - if( clientNum == -1 ) - { - trap_SendServerCommand( ent-g_entities, - "print \"callteamvote: invalid player\n\"" ); - return; - } - if( !level.clients[ clientNum ].pers.denyBuild ) { trap_SendServerCommand( ent-g_entities, @@ -1478,13 +1444,16 @@ int team, cs_offset; char msg[ 64 ]; - team = ent->client->ps.stats[ STAT_PTEAM ]; + team = ent->client->pers.teamSelection; if( team == PTE_HUMANS ) cs_offset = 0; else if( team == PTE_ALIENS ) cs_offset = 1; else + { + trap_SendServerCommand( ent-g_entities, "print \"Not allowed to vote as spectator\n\"" ); return; + } if( !level.teamVoteTime[ cs_offset ] ) { @@ -1498,12 +1467,6 @@ return; } - if( ent->client->pers.teamSelection == PTE_NONE ) - { - trap_SendServerCommand( ent-g_entities, "print \"Not allowed to vote as spectator\n\"" ); - return; - } - trap_SendServerCommand( ent-g_entities, "print \"Team vote cast\n\"" ); ent->client->ps.eFlags |= EF_TEAMVOTED;