From 35ee9b1554981454b1a402e3764044299c9d0661 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 17 Jul 2005 22:21:09 +0000 Subject: * 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 --- src/game/g_main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/game/g_main.c') 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\"" ); -- cgit