diff options
author | Tim Angus <tim@ngus.net> | 2005-07-17 22:21:09 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-07-17 22:21:09 +0000 |
commit | 35ee9b1554981454b1a402e3764044299c9d0661 (patch) | |
tree | 9735da1d77e23685aab739f33c962d31350e91c6 /src/game/g_main.c | |
parent | b5ac53b13319050369c3baba84554b0561db6c96 (diff) |
* Plugged the "sell and buy gets you full ammo" exploit
* Changed voting system to need a majority of connected clients to pass without time out and a majority of voting clients to pass with time out
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index 15b19df9..94175c4d 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1649,17 +1649,27 @@ void CheckVote( void ) if( level.time - level.voteTime >= VOTE_TIME ) { - trap_SendServerCommand( -1, "print \"Vote failed.\n\"" ); + if( level.voteYes > level.voteNo ) + { + // execute the command, then remove the vote + trap_SendServerCommand( -1, "print \"Vote passed.\n\"" ); + level.voteExecuteTime = level.time + 3000; + } + else + { + // same behavior as a timeout + trap_SendServerCommand( -1, "print \"Vote failed.\n\"" ); + } } else { - if( level.voteYes > level.numVotingClients / 2 ) + if( level.voteYes > level.numConnectedClients / 2 ) { // execute the command, then remove the vote trap_SendServerCommand( -1, "print \"Vote passed.\n\"" ); level.voteExecuteTime = level.time + 3000; } - else if( level.voteNo >= level.numVotingClients / 2 ) + else if( level.voteNo >= level.numConnectedClients / 2 ) { // same behavior as a timeout trap_SendServerCommand( -1, "print \"Vote failed.\n\"" ); |