r2984 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Nov 21 11:11:45 EST 2007


Author: div0
Date: 2007-11-21 11:11:45 -0500 (Wed, 21 Nov 2007)
New Revision: 2984

Modified:
   trunk/data/qcsrc/common/mapinfo.qc
Log:
new mapinfo syntax:
	settemp_for_type all sv_cullentities_trace 0
	settemp_for_type ctf sv_fullbright_players 1


Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2007-11-17 16:55:29 UTC (rev 2983)
+++ trunk/data/qcsrc/common/mapinfo.qc	2007-11-21 16:11:45 UTC (rev 2984)
@@ -333,6 +333,7 @@
 	else if(t == "kh")    return MAPINFO_TYPE_KEYHUNT;
 	else if(t == "as")    return MAPINFO_TYPE_ASSAULT;
 	else if(t == "ons")   return MAPINFO_TYPE_ONSLAUGHT;
+	else if(t == "all")   return MAPINFO_TYPE_ALL;
 	else                  return 0;
 }
 
@@ -416,6 +417,38 @@
 			else
 				dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
 		}
+		else if(t == "settemp_for_type")
+		{
+			t = car(s); s = cdr(s);
+			if((f = MapInfo_Type_FromString(t)))
+			{
+				if(f & pGametypeToSet)
+				{
+					t = car(s); s = cdr(s);
+					if(strstrofs(t, "\"", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(strstrofs(t, "\\", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(strstrofs(t, ";", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(strstrofs(s, "\"", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(strstrofs(s, "\\", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(strstrofs(s, ";", 0) >= 0)
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else
+					{
+						dprint("Applying temporary setting ", t, " := ", s, "\n");
+						localcmd(strcat("\nsettemp ", t, " \"", s, "\"\n"));
+					}
+				}
+			}
+			else
+			{
+				dprint("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
+			}
+		}
 		else
 			dprint("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
 	}




More information about the nexuiz-commits mailing list