diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_cmds.c | 8 | ||||
-rw-r--r-- | src/game/g_local.h | 4 | ||||
-rw-r--r-- | src/game/g_main.c | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 5f574f20..e435c999 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1258,7 +1258,7 @@ void Cmd_CallVote_f( gentity_t *ent ) level.voteDisplayString[ team ] ); ent->client->pers.namelog->voteCount++; - ent->client->pers.vote[ team ] = qtrue; + ent->client->pers.vote |= 1 << team; G_Vote( ent, team, qtrue ); } @@ -1283,7 +1283,7 @@ void Cmd_Vote_f( gentity_t *ent ) return; } - if( ent->client->pers.voted[ team ] ) + if( ent->client->pers.voted & ( 1 << team ) ) { trap_SendServerCommand( ent-g_entities, va( "print \"%s: vote already cast\n\"", cmd ) ); @@ -1294,8 +1294,8 @@ void Cmd_Vote_f( gentity_t *ent ) va( "print \"%s: vote cast\n\"", cmd ) ); trap_Argv( 1, vote, sizeof( vote ) ); - ent->client->pers.vote[ team ] = - ( tolower( vote[ 0 ] ) == 'y' || vote[ 0 ] == '1' ); + ent->client->pers.vote |= + ( tolower( vote[ 0 ] ) == 'y' || vote[ 0 ] == '1' ) << team; G_Vote( ent, team, qtrue ); } diff --git a/src/game/g_local.h b/src/game/g_local.h index 0a895820..a4acf39b 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -325,8 +325,8 @@ typedef struct // used to save persistant[] values while in SPECTATOR_FOLLOW mode int credit; - qboolean voted[ NUM_TEAMS ]; - qboolean vote[ NUM_TEAMS ]; + int voted; + int vote; // flood protection int floodDemerits; diff --git a/src/game/g_main.c b/src/game/g_main.c index 6766e9ef..2f708235 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -2028,15 +2028,15 @@ void G_Vote( gentity_t *ent, team_t team, qboolean voting ) if( !level.voteTime[ team ] ) return; - if( voting && ent->client->pers.voted[ team ] ) + if( voting && ent->client->pers.voted & ( 1 << team ) ) return; - if( !voting && !ent->client->pers.voted[ team ] ) + if( !voting && !( ent->client->pers.voted & ( 1 << team ) ) ) return; - ent->client->pers.voted[ team ] = voting; + ent->client->pers.voted |= 1 << team; - if( ent->client->pers.vote[ team ] ) + if( ent->client->pers.vote & ( 1 << team ) ) { if( voting ) level.voteYes[ team ]++; @@ -2142,7 +2142,7 @@ void G_CheckVote( team_t team ) level.voteNo[ team ] = 0; for( i = 0; i < level.maxclients; i++ ) - level.clients[ i ].pers.voted[ team ] = qfalse; + level.clients[ i ].pers.voted &= ~( 1 << team ); trap_SetConfigstring( CS_VOTE_TIME + team, "" ); trap_SetConfigstring( CS_VOTE_STRING + team, "" ); |