summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-21 08:55:16 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:58 +0000
commit7ebef7d524d3ef50d35e14a57096ef51d41bd134 (patch)
tree817620d8cee24b9803ac336edba0daf86b8b1825 /src
parentea8335a4b1bb9dce58b37c8062ac7427ec3e2b41 (diff)
* Fix votes from needing to be unanimous to pass, introduced in r1754
Diffstat (limited to 'src')
-rw-r--r--src/game/g_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 4cfd9346..3c676de1 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -2085,6 +2085,7 @@ void CheckVote( team_t team )
qboolean pass = qfalse;
char *msg;
int i;
+ float yesPercent;
if( level.voteExecuteTime[ team ] &&
level.voteExecuteTime[ team ] < level.time )
@@ -2103,16 +2104,16 @@ void CheckVote( team_t team )
if( !level.voteTime[ team ] )
return;
+ yesPercent = (float)level.voteYes[ team ] / (float)level.numVotingClients[ team ];
+
if( ( level.time - level.voteTime[ team ] >= VOTE_TIME ) ||
( level.voteYes[ team ] + level.voteNo[ team ] == level.numVotingClients[ team ] ) )
{
- pass = (float)level.voteYes[ team ] / 100.0f > votePassThreshold ||
- level.voteNo[ team ] == 0;
+ pass = ( yesPercent > votePassThreshold || level.voteNo[ team ] == 0 );
}
else
{
- if( (float)level.voteYes[ team ] / 100.0f >
- (float)level.numVotingClients[ team ] * votePassThreshold )
+ if( yesPercent > (float)level.numVotingClients[ team ] * votePassThreshold )
{
pass = qtrue;
}