r4651 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Oct 7 04:54:16 EDT 2008


Author: div0
Date: 2008-10-07 04:54:02 -0400 (Tue, 07 Oct 2008)
New Revision: 4651

Modified:
   trunk/data/qcsrc/server/gamecommand.qc
Log:
add option "sv_cmd roughmap --quit" to exit the server when done (to allow using roughmap in scripts)


Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc	2008-10-07 07:55:43 UTC (rev 4650)
+++ trunk/data/qcsrc/server/gamecommand.qc	2008-10-07 08:54:02 UTC (rev 4651)
@@ -98,8 +98,12 @@
 			if(self.cnt >= 0)
 			{
 				print(self.netname, " already exists, aborting (you may want to specify --force)\n");
-				if(self.count & 2)
+				if(self.count & 4)
 				{
+					localcmd("quit\n");
+				}
+				else if(self.count & 2)
+				{
 					if(self.count & 1)
 						localcmd("defer 1 \"sv_cmd roughmap --force --loop\"\n");
 					else
@@ -107,6 +111,7 @@
 					GotoNextMap();
 				}
 				remove(self);
+				roughmapper = world;
 				return;
 			}
 		}
@@ -156,8 +161,12 @@
 		fputs(self.cnt, "};\n");
 		fclose(self.cnt);
 		print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
-		if(self.count & 2)
+		if(self.count & 4)
 		{
+			localcmd("quit\n");
+		}
+		else if(self.count & 2)
+		{
 			if(self.count & 1)
 				localcmd("defer 1 \"sv_cmd roughmap --force --loop\"\n");
 			else
@@ -186,6 +195,8 @@
 			roughmapper.count |= 1;
 		if(argv(i) == "--loop")
 			roughmapper.count |= 2;
+		if(argv(i) == "--quit")
+			roughmapper.count |= 4;
 	}
 }
 




More information about the nexuiz-commits mailing list