From efd0dbab25533b67c0b231767318e903faf61f3c Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Mon, 12 Jan 2009 19:35:38 +0000 Subject: added vote command on the server to enforce a vote. added sv_vote_kick_bantime to choose how long a user will be banned at votekick (0 for just kick) thanks to magnet and xara --- src/game/server/gamecontext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/game/server/gamecontext.cpp') diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 087dd469..287fe767 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -236,6 +236,7 @@ void GAMECONTEXT::start_vote(const char *desc, const char *command) return; // reset votes + vote_enforce = VOTE_ENFORCE_UNKNOWN; for(int i = 0; i < MAX_CLIENTS; i++) { if(players[i]) @@ -343,7 +344,7 @@ void GAMECONTEXT::tick() } } - if(yes >= total/2+1) + if(vote_enforce == VOTE_ENFORCE_YES || yes >= total/2+1) { console_execute_line(vote_command); end_vote(); @@ -352,7 +353,7 @@ void GAMECONTEXT::tick() if(players[vote_creator]) players[vote_creator]->last_votecall = 0; } - else if(time_get() > vote_closetime || no >= total/2+1 || yes+no == total) + else if(vote_enforce == VOTE_ENFORCE_NO || time_get() > vote_closetime || no >= total/2+1 || yes+no == total) { end_vote(); send_chat(-1, GAMECONTEXT::CHAT_ALL, "Vote failed"); -- cgit 1.4.1