r6087 - in trunk/data/qcsrc: client server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 9 08:23:05 EDT 2009


Author: div0
Date: 2009-03-09 08:23:05 -0400 (Mon, 09 Mar 2009)
New Revision: 6087

Modified:
   trunk/data/qcsrc/client/mapvoting.qc
   trunk/data/qcsrc/server/g_world.qc
Log:
try to fix the "don't care" message spam


Modified: trunk/data/qcsrc/client/mapvoting.qc
===================================================================
--- trunk/data/qcsrc/client/mapvoting.qc	2009-03-09 12:14:19 UTC (rev 6086)
+++ trunk/data/qcsrc/client/mapvoting.qc	2009-03-09 12:23:05 UTC (rev 6087)
@@ -241,7 +241,7 @@
 	pak.chain = mv_pk3list;
 	mv_pk3list = pak;
 	
-	if(pk3 != "" && pk3 != "don't care") // TODO make this less stupid, but I am lazy now
+	if(pk3 != "")
 	{
 		localcmd(strcat("\ncurl --pak ", pk3, "; wait; cl_cmd mv_download ", ftos(id), "\n"));
 	}
@@ -253,6 +253,10 @@
 
 void MapVote_CheckPic(string pic, string pk3, float id)
 {
+	// never try to retrieve a pic for the "don't care" 'map'
+	if(mv_abstain && id == mv_num_maps - 1)
+		return;
+
 	if(PreviewExists(pic))
 	{
 		mv_preview[id] = true;

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2009-03-09 12:14:19 UTC (rev 6086)
+++ trunk/data/qcsrc/server/g_world.qc	2009-03-09 12:23:05 UTC (rev 6087)
@@ -2133,16 +2133,24 @@
 		for(i = 0; i < mapvote_count; ++i)
 			if(mapvote_maps[i] != "")
 			{
-				WriteString(MSG_ENTITY, mapvote_maps[i]);
-				mapfile = strcat(mapvote_screenshot_dir, "/", mapvote_maps[i]);
-				pakfile = whichpack(strcat(mapfile, ".tga"));
-				if(pakfile == "")
-					pakfile = whichpack(strcat(mapfile, ".jpg"));
-				if(pakfile == "")
-					pakfile = whichpack(strcat(mapfile, ".png"));
-				for(o = strstr(pakfile, "/", 0)+1; o > 0; o = strstr(pakfile, "/", 0)+1)
-					pakfile = substring(pakfile, o, 999);
-				WriteString(MSG_ENTITY, pakfile);
+				if(mapvote_abstain && i == mapvote_count - 1)
+				{
+					WriteString(MSG_ENTITY, ""); // abstain needs no text
+					WriteString(MSG_ENTITY, ""); // abstain needs no pack
+				}
+				else
+				{
+					WriteString(MSG_ENTITY, mapvote_maps[i]);
+					mapfile = strcat(mapvote_screenshot_dir, "/", mapvote_maps[i]);
+					pakfile = whichpack(strcat(mapfile, ".tga"));
+					if(pakfile == "")
+						pakfile = whichpack(strcat(mapfile, ".jpg"));
+					if(pakfile == "")
+						pakfile = whichpack(strcat(mapfile, ".png"));
+					for(o = strstr(pakfile, "/", 0)+1; o > 0; o = strstr(pakfile, "/", 0)+1)
+						pakfile = substring(pakfile, o, 999);
+					WriteString(MSG_ENTITY, pakfile);
+				}
 			}
 	}
 




More information about the nexuiz-commits mailing list