r3368 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 13 06:58:33 EST 2008


Author: div0
Date: 2008-02-13 06:58:22 -0500 (Wed, 13 Feb 2008)
New Revision: 3368

Modified:
   trunk/data/qcsrc/server/clientcommands.qc
Log:
improved vote messages a bit


Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2008-02-13 11:45:46 UTC (rev 3367)
+++ trunk/data/qcsrc/server/clientcommands.qc	2008-02-13 11:58:22 UTC (rev 3368)
@@ -713,11 +713,21 @@
 void VoteSpam(float yescount, float nocount, float abstaincount, float notvoters, float mincount)
 {
 	string s;
-	s = strcat("\{1}^2* vote results: ^1", ftos(yescount), "^2:^1");
-	s = strcat(s, ftos(nocount), "^2 (^1");
-	s = strcat(s, ftos(mincount), "^2 needed), ^1");
-	s = strcat(s, ftos(abstaincount), "^2 didn't care, ^1");
-	s = strcat(s, ftos(notvoters), "^2 didn't vote\n");
+	if(mincount >= 0)
+	{
+		s = strcat("\{1}^2* vote results: ^1", ftos(yescount), "^2:^1");
+		s = strcat(s, ftos(nocount), "^2 (^1");
+		s = strcat(s, ftos(mincount), "^2 needed), ^1");
+		s = strcat(s, ftos(abstaincount), "^2 didn't care, ^1");
+		s = strcat(s, ftos(notvoters), "^2 didn't vote\n");
+	}
+	else
+	{
+		s = strcat("\{1}^2* vote results: ^1", ftos(yescount), "^2:^1");
+		s = strcat(s, ftos(nocount), "^2 (^1");
+		s = strcat(s, ftos(abstaincount), "^2 didn't care, ^1");
+		s = strcat(s, ftos(notvoters), "^2 didn't have to vote\n");
+	}
 	bprint(s);
 }
 
@@ -759,12 +769,12 @@
 		votefactor = bound(0.5, cvar("sv_vote_majority_factor"), 0.999);
 		if(yescount > (playercount - abstaincount) * votefactor)
 		{
-			VoteSpam(yescount, nocount, abstaincount, playercount - yescount - nocount - abstaincount, floor((playercount - abstaincount) * votefactor) + 1);
+			VoteSpam(yescount, nocount, abstaincount, playercount - yescount - nocount - abstaincount, -1);
 			VoteAccept();
 		}
 		else if(nocount >= (playercount - abstaincount) * (1 - votefactor)) // that means, yescount cannot reach minyes any more
 		{
-			VoteSpam(yescount, nocount, abstaincount, playercount - yescount - nocount - abstaincount, floor((playercount - abstaincount) * votefactor) + 1);
+			VoteSpam(yescount, nocount, abstaincount, playercount - yescount - nocount - abstaincount, -1);
 			VoteReject();
 		}
 		else if(time > votefinished)




More information about the nexuiz-commits mailing list