about summary refs log tree commit diff
path: root/src/game/server/gamecontext.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-25 12:23:44 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-25 12:23:44 +0000
commitaaaba4f4039f3643d1a040dfe1c9715be49371e2 (patch)
treec396f83ae65eaa4b0f7799eb3650de6b72276dd9 /src/game/server/gamecontext.cpp
parent059c2ee4cb4d0860b1faf86f2f3b17511260867c (diff)
downloadzcatch-aaaba4f4039f3643d1a040dfe1c9715be49371e2.tar.gz
zcatch-aaaba4f4039f3643d1a040dfe1c9715be49371e2.zip
continued on the voting
Diffstat (limited to 'src/game/server/gamecontext.cpp')
-rw-r--r--src/game/server/gamecontext.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index f896a140..ca335896 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -264,7 +264,7 @@ void GAMECONTEXT::send_vote_status(int cid)
 			msg.total++;
 			if(players[i]->vote > 0)
 				msg.yes++;
-			else if(players[i]->vote > 0)
+			else if(players[i]->vote < 0)
 				msg.no++;
 			else
 				msg.pass++;
@@ -302,18 +302,22 @@ void GAMECONTEXT::tick()
 				total++;
 				if(players[i]->vote > 0)
 					yes++;
-				else if(players[i]->vote > 0)
+				else if(players[i]->vote < 0)
 					no++;
 			}
 		}
 		
-		if(yes > (total+1)/2)
+		if(yes >= (total+1)/2)
 		{
 			console_execute_line(vote_command);
 			vote_closetime = 0;
+			send_chat(-1, GAMECONTEXT::CHAT_ALL, "Vote passed");
 		}
-		else if(time_get() > vote_closetime || no > (total+1)/2)
+		else if(time_get() > vote_closetime || no >= (total+1)/2)
+		{
+			send_chat(-1, GAMECONTEXT::CHAT_ALL, "Vote failed");
 			vote_closetime = 0;
+		}
 	}
 }