summaryrefslogtreecommitdiff
path: root/src/botlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/botlib')
-rw-r--r--src/botlib/be_interface.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/botlib/be_interface.c b/src/botlib/be_interface.c
index e70a6d4a..2980674e 100644
--- a/src/botlib/be_interface.c
+++ b/src/botlib/be_interface.c
@@ -138,12 +138,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%c" BASEGAME "%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");