aboutsummaryrefslogtreecommitdiffstats
path: root/code/botlib
diff options
context:
space:
mode:
Diffstat (limited to 'code/botlib')
-rw-r--r--code/botlib/be_interface.c14
1 files changed, 13 insertions, 1 deletions
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");