about summary refs log tree commit diff
path: root/src/game/server/gamecontext.cpp
diff options
context:
space:
mode:
authorAlfred Eriksson <somerunce@gmail.com>2009-01-12 19:35:38 +0000
committerAlfred Eriksson <somerunce@gmail.com>2009-01-12 19:35:38 +0000
commitefd0dbab25533b67c0b231767318e903faf61f3c (patch)
treedf1e02fdacd121658360539951fdfab52ea24f84 /src/game/server/gamecontext.cpp
parent2693bfdaecae78af20b12daff0c3b4eb2888203c (diff)
downloadzcatch-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.cpp5
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");