[nexuiz-commits] r7171 - in trunk/data: . qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jul 9 12:32:50 EDT 2009


Author: div0
Date: 2009-07-09 12:32:49 -0400 (Thu, 09 Jul 2009)
New Revision: 7171

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/common/mapinfo.qc
Log:
g_mapinfo_* settings


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-07-08 18:59:04 UTC (rev 7170)
+++ trunk/data/defaultNexuiz.cfg	2009-07-09 16:32:49 UTC (rev 7171)
@@ -1603,3 +1603,6 @@
 set sv_loddistance1 1024
 set sv_loddistance2 4096
 seta cl_playerdetailreduction 0	"the higher, the less detailed player models are displayed (LOD)"
+
+set g_mapinfo_settemp_allow "" "when set, only cvars mentioned here may be changed by mapinfo files"
+set g_mapinfo_settemp_deny "" "when set, cvars mentioned here may not be changed by mapinfo files"

Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2009-07-08 18:59:04 UTC (rev 7170)
+++ trunk/data/qcsrc/common/mapinfo.qc	2009-07-09 16:32:49 UTC (rev 7171)
@@ -493,7 +493,11 @@
 	string s, t;
 	float fh, fh2;
 	float r, f, n, i;
+	string allow, deny;
 
+	allow = cvar_string("g_mapinfo_settemp_allow");
+	deny = cvar_string("g_mapinfo_settemp_deny");
+
 	if(strstrofs(pFilename, "/", 0) >= 0)
 	{
 		print("Invalid character in map name, ignored\n");
@@ -680,6 +684,12 @@
 						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
 					else if not (cvar_value_issafe(s))
 						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(substring(t, 0, 10) == "g_mapinfo_")
+						print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+					else if(allow != "" && strstrofs(strcat(" ", allow, " "), strcat(" ", t, " "), 0) < 0)
+						print("Map ", pFilename, " contains a denied setting, ignored\n");
+					else if(deny != "" && strstrofs(strcat(" ", deny, " "), strcat(" ", t, " "), 0) >= 0)
+						print("Map ", pFilename, " contains a denied setting, ignored\n");
 					else
 					{
 						dprint("Applying temporary setting ", t, " := ", s, "\n");



More information about the nexuiz-commits mailing list