summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2010-03-02 18:05:32 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:29 +0000
commitaf1497d4f6974219a6a81821dc5d8a00343722cc (patch)
treeb999004fb7634e95da14371539d6b8239d8c90b0 /src/game/g_main.c
parent24d30c07f57f9f0ace0c945c7c41a38188844d2e (diff)
* Use bitmasks instead of arrays for keeping track of whether/how a player voted
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c10
1 files changed, 5 insertions, 5 deletions
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, "" );