[quake3-commits] r1676 - trunk/code/botlib

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Oct 17 18:35:45 EDT 2009


Author: thilo
Date: 2009-10-17 18:35:45 -0400 (Sat, 17 Oct 2009)
New Revision: 1676

Modified:
   trunk/code/botlib/be_interface.c
Log:
Only create botlib.log if in bot developer mode.


Modified: trunk/code/botlib/be_interface.c
===================================================================
--- trunk/code/botlib/be_interface.c	2009-10-17 22:06:51 UTC (rev 1675)
+++ trunk/code/botlib/be_interface.c	2009-10-17 22:35:45 UTC (rev 1676)
@@ -136,29 +136,35 @@
 int Export_BotLibSetup(void)
 {
 	int		errnum;
-	char		logfilename[MAX_OSPATH];
-	char		*homedir, *gamedir;
 	
 	botDeveloper = LibVarGetValue("bot_developer");
  	memset( &botlibglobals, 0, sizeof(botlibglobals) );
 	//initialize byte swapping (litte endian etc.)
 //	Swap_Init();
-	homedir = LibVarGetString("homedir");
-	gamedir = LibVarGetString("gamedir");
-	if (homedir[0]) {
-		if (gamedir[0]) {
-			Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
+
+	if(botDeveloper)
+	{
+		char *homedir, *gamedir;
+		char logfilename[MAX_OSPATH];
+
+		homedir = LibVarGetString("homedir");
+		gamedir = LibVarGetString("gamedir");
+
+		if (*homedir)
+		{
+			if(*gamedir)
+				Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
+			else
+				Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
 		}
-		else {
-			Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
-		}
-	} else {
-		Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
+		else
+			Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
+	
+		Log_Open(logfilename);
 	}
-	Log_Open(logfilename);
-	//
+
 	botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
-	//
+
 	botlibglobals.maxclients = (int) LibVarValue("maxclients", "128");
 	botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024");
 



More information about the quake3-commits mailing list