From cd8d5ec83383bac3525bc3ba9ea1c039ab7a1d61 Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 7 Oct 2008 08:54:02 +0000 Subject: [PATCH] add option "sv_cmd roughmap --quit" to exit the server when done (to allow using roughmap in scripts) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4651 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/gamecommand.qc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/server/gamecommand.qc b/data/qcsrc/server/gamecommand.qc index 8fb854446..f12826093 100644 --- a/data/qcsrc/server/gamecommand.qc +++ b/data/qcsrc/server/gamecommand.qc @@ -98,7 +98,11 @@ void RoughMap_Think() 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"); @@ -107,6 +111,7 @@ void RoughMap_Think() GotoNextMap(); } remove(self); + roughmapper = world; return; } } @@ -156,7 +161,11 @@ void RoughMap_Think() 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"); @@ -186,6 +195,8 @@ void RoughMap(float argc) roughmapper.count |= 1; if(argv(i) == "--loop") roughmapper.count |= 2; + if(argv(i) == "--quit") + roughmapper.count |= 4; } } -- 2.39.2