[nexuiz-commits] r6278 - in trunk/data: maps qcsrc/common qcsrc/menu/nexuiz qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Mar 24 13:26:57 EDT 2009


Author: div0
Date: 2009-03-24 13:26:57 -0400 (Tue, 24 Mar 2009)
New Revision: 6278

Added:
   trunk/data/maps/walker_pathtest2.mapinfo
Modified:
   trunk/data/maps/turret_test.mapinfo
   trunk/data/qcsrc/common/gamecommand.qc
   trunk/data/qcsrc/common/mapinfo.qc
   trunk/data/qcsrc/common/mapinfo.qh
   trunk/data/qcsrc/menu/nexuiz/maplist.c
   trunk/data/qcsrc/server/g_world.qc
   trunk/data/qcsrc/server/gamecommand.qc
   trunk/data/qcsrc/server/miscfunctions.qc
Log:
- add a "forbidden" flag to mapinfo that's stronger than hidden, and set it for turret_test and walker_pathtest2
- move gun down by 2 more units when in shootfromcenter mode


Modified: trunk/data/maps/turret_test.mapinfo
===================================================================
--- trunk/data/maps/turret_test.mapinfo	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/maps/turret_test.mapinfo	2009-03-24 17:26:57 UTC (rev 6278)
@@ -11,4 +11,4 @@
 // optional: settemp_for_type (all|gametypename) cvarname value
 // optional: clientsettemp_for_type (all|gametypename) cvarname value
 // optional: size mins_x mins_y mins_z maxs_x maxs_y maxs_z
-hidden
+forbidden

Added: trunk/data/maps/walker_pathtest2.mapinfo
===================================================================
--- trunk/data/maps/walker_pathtest2.mapinfo	                        (rev 0)
+++ trunk/data/maps/walker_pathtest2.mapinfo	2009-03-24 17:26:57 UTC (rev 6278)
@@ -0,0 +1,11 @@
+title <TITLE>
+description <DESCRIPTION>
+author <AUTHOR>
+cdtrack 2
+// uncomment this if you added weapon pickups: has weapons
+// optional: fog density red green blue alpha mindist maxdist
+// optional: settemp_for_type (all|gametypename) cvarname value
+// optional: clientsettemp_for_type (all|gametypename) cvarname value
+// optional: size mins_x mins_y mins_z maxs_x maxs_y maxs_z
+// optional: hidden
+forbidden

Modified: trunk/data/qcsrc/common/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/common/gamecommand.qc	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/common/gamecommand.qc	2009-03-24 17:26:57 UTC (rev 6278)
@@ -126,9 +126,9 @@
 		{
 			MapInfo_Enumerate();
 			if(cvar("g_maplist_allow_hidden"))
-				i = 0;
+				i = MAPINFO_FLAG_FORBIDDEN;
 			else
-				i = MAPINFO_FLAG_HIDDEN;
+				i = MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN;
 			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, i, 0);
 			n = tokenizebyseparator(cvar_string("g_maplist"), " ");
 			s2 = "";

Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/common/mapinfo.qc	2009-03-24 17:26:57 UTC (rev 6278)
@@ -657,6 +657,10 @@
 		{
 			MapInfo_Map_flags |= MAPINFO_FLAG_HIDDEN;
 		}
+		else if(t == "forbidden")
+		{
+			MapInfo_Map_flags |= MAPINFO_FLAG_FORBIDDEN;
+		}
 		else if(t == "type")
 		{
 			t = car(s); s = cdr(s);

Modified: trunk/data/qcsrc/common/mapinfo.qh
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qh	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/common/mapinfo.qh	2009-03-24 17:26:57 UTC (rev 6278)
@@ -14,6 +14,7 @@
 float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
 
 float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
+float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
 
 float MapInfo_count;
 

Modified: trunk/data/qcsrc/menu/nexuiz/maplist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/maplist.c	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/menu/nexuiz/maplist.c	2009-03-24 17:26:57 UTC (rev 6278)
@@ -202,7 +202,7 @@
 	float gt, f;
 	gt = MapInfo_CurrentGametype();
 	f = MapInfo_CurrentFeatures();
-	MapInfo_FilterGametype(gt, f, 0, MAPINFO_FLAG_HIDDEN, 0);
+	MapInfo_FilterGametype(gt, f, 0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN, 0);
 	me.nItems = MapInfo_count;
 	for(i = 0; i < MapInfo_count; ++i)
 		draw_PreloadPicture(strcat("/maps/", MapInfo_BSPName_ByID(i)));
@@ -235,7 +235,7 @@
 {
 	float i;
 	string s;
-	MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, MAPINFO_FLAG_HIDDEN, 0); // all
+	MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN, 0); // all
 	s = "";
 	for(i = 0; i < MapInfo_count; ++i)
 		s = strcat(s, " ", MapInfo_BSPName_ByID(i));

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/server/g_world.qc	2009-03-24 17:26:57 UTC (rev 6278)
@@ -146,7 +146,7 @@
 		cvar_set("g_maplist_index", ftos(n - 1)); // jump to map 0 in GotoNextMap
 
 		MapInfo_Enumerate();
-		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 0);
+		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN) | MAPINFO_FLAG_FORBIDDEN, 0);
 
 		if(!DoNextMapOverride())
 			GotoNextMap();
@@ -361,7 +361,7 @@
 
 	g_maplist_allow_hidden = cvar("g_maplist_allow_hidden");
 	MapInfo_Enumerate();
-	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 0);
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN) | MAPINFO_FLAG_FORBIDDEN, 0);
 }
 
 void Map_MarkAsRecent(string m);
@@ -541,7 +541,7 @@
 	orig_slowmo = cvar("slowmo");
 
 	MapInfo_Enumerate();
-	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1);
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN) | MAPINFO_FLAG_FORBIDDEN, 1);
 
 	if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
 	{
@@ -599,7 +599,7 @@
 	for(i = 0, j = 0; i < MapInfo_count; ++i)
 	{
 		if(MapInfo_Get_ByID(i))
-			if not(MapInfo_Map_flags & MAPINFO_FLAG_HIDDEN)
+			if not(MapInfo_Map_flags & (MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN))
 			{
 				if(mod(i, 2))
 					col = "^2";
@@ -905,7 +905,7 @@
 	if(Map_Count == 0)
 	{
 		bprint( "Maplist is empty!  Resetting it to default map list.\n" );
-		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN));
 		if(cvar("g_maplist_shuffle"))
 			ShuffleMaplist();
 		localcmd("\nmenu_cmd sync\n");
@@ -1025,7 +1025,7 @@
 			if(allowReset)
 			{
 				bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
-				cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+				cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN));
 				if(cvar("g_maplist_shuffle"))
 					ShuffleMaplist();
 				localcmd("\nmenu_cmd sync\n");
@@ -2059,7 +2059,7 @@
 	if(mapvote_count == 0)
 	{
 		bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
-		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN));
 		if(cvar("g_maplist_shuffle"))
 			ShuffleMaplist();
 		localcmd("\nmenu_cmd sync\n");
@@ -2387,7 +2387,7 @@
 		return;
 
 	MapInfo_Enumerate();
-	if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1))
+	if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN) | MAPINFO_FLAG_FORBIDDEN, 1))
 		mapvote_run = TRUE;
 }
 void MapVote_Think()
@@ -2526,7 +2526,7 @@
 	// Mapinfo
 	MapInfo_Shutdown();
 	MapInfo_Enumerate();
-	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1);
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN) | MAPINFO_FLAG_FORBIDDEN, 1);
 }
 
 void SV_Shutdown()

Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/server/gamecommand.qc	2009-03-24 17:26:57 UTC (rev 6278)
@@ -564,7 +564,7 @@
 	if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
 	{
 		print("Done rebuiling mapinfos.\n");
-		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
+		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0) | MAPINFO_FLAG_FORBIDDEN, 0);
 		remove(self);
 	}
 	else
@@ -652,17 +652,17 @@
 		if(t)
 		{
 			MapInfo_SwitchGameType(t);
-			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, MAPINFO_FLAG_HIDDEN, 0);
+			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN, 0);
 			if(MapInfo_count > 0)
 			{
 				bprint("Game type successfully switched to ", s, "\n");
-				MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
+				MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0) | MAPINFO_FLAG_FORBIDDEN, 0);
 			}
 			else
 			{
 				bprint("Cannot use this game type: no map for it found\n");
 				MapInfo_SwitchGameType(tsave);
-				MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
+				MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0) | MAPINFO_FLAG_FORBIDDEN, 0);
 			}
 		}
 		else

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2009-03-24 15:24:18 UTC (rev 6277)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2009-03-24 17:26:57 UTC (rev 6278)
@@ -2033,7 +2033,7 @@
 		if(visual)
 		{
 			vecs_y = 0;
-			vecs_z -= 2;
+			vecs_z -= 4;
 		}
 		else
 		{
@@ -2044,7 +2044,7 @@
 	else if (cvar("g_shootfromcenter"))
 	{
 		vecs_y = 0;
-		vecs_z -= 2;
+		vecs_z -= 4;
 	}
 	return vecs;
 }



More information about the nexuiz-commits mailing list