From 359864866cdaab7fad5ae6b734f4b011e0e75bb3 Mon Sep 17 00:00:00 2001 From: thilo Date: Fri, 21 Apr 2006 17:04:21 +0000 Subject: - botlib logfile now gets stored in the fs_game directory in fs_homepath. (patch from Erik Auerswald) - Added proper error handling when fopening qconsole.log - Fixed bug where r_chat.c gets loaded in botlib even when bot_nochat is 1. git-svn-id: svn://svn.icculus.org/quake3/trunk@715 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/botlib/be_interface.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'code/botlib') diff --git a/code/botlib/be_interface.c b/code/botlib/be_interface.c index b6862af..067b257 100644 --- a/code/botlib/be_interface.c +++ b/code/botlib/be_interface.c @@ -137,12 +137,24 @@ int Export_BotLibSetup(void) { int errnum; char logfilename[MAX_QPATH]; + char *homedir, *gamedir; bot_developer = LibVarGetValue("bot_developer"); memset( &botlibglobals, 0, sizeof(botlibglobals) ); // bk001207 - init //initialize byte swapping (litte endian etc.) // Swap_Init(); - Com_sprintf(logfilename, sizeof(logfilename), "%s%cbotlib.log", LibVarGetString("homedir"), PATH_SEP); + 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); + } + else { + Com_sprintf(logfilename, sizeof(logfilename), "%s%cbaseq3%cbotlib.log", homedir, PATH_SEP, PATH_SEP); + } + } else { + Com_sprintf(logfilename, sizeof(logfilename), "botlib.log"); + } Log_Open(logfilename); // botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n"); -- cgit v1.2.3