diff options
| author | Alfred Eriksson <somerunce@gmail.com> | 2009-01-12 19:35:38 +0000 |
|---|---|---|
| committer | Alfred Eriksson <somerunce@gmail.com> | 2009-01-12 19:35:38 +0000 |
| commit | efd0dbab25533b67c0b231767318e903faf61f3c (patch) | |
| tree | df1e02fdacd121658360539951fdfab52ea24f84 /src/game/server/gamecontext.cpp | |
| parent | 2693bfdaecae78af20b12daff0c3b4eb2888203c (diff) | |
| download | zcatch-efd0dbab25533b67c0b231767318e903faf61f3c.tar.gz zcatch-efd0dbab25533b67c0b231767318e903faf61f3c.zip | |
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
Diffstat (limited to 'src/game/server/gamecontext.cpp')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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"); |