Give botlib com_basegame for botlib.log path

Before it always used BASEGAME fallback code.
This commit is contained in:
Zack Middleton 2013-04-22 23:11:10 -05:00
parent b95d8a91aa
commit feb012152c
3 changed files with 10 additions and 7 deletions

View file

@ -144,19 +144,19 @@ int Export_BotLibSetup(void)
if(botDeveloper)
{
char *homedir, *gamedir, *basedir;
char *homedir, *gamedir, *basegame;
char logfilename[MAX_OSPATH];
homedir = LibVarGetString("homedir");
gamedir = LibVarGetString("gamedir");
basedir = LibVarGetString("com_basegame");
basegame = LibVarGetString("basegame");
if (*homedir)
{
if(*gamedir)
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
else if(*basedir)
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, basedir, PATH_SEP);
else if(*basegame)
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, basegame, PATH_SEP);
else
Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
}

View file

@ -437,9 +437,10 @@ botlib_export_t *GetBotLibAPI( int apiVersion, botlib_import_t *import );
name: default: module(s): description:
"basedir" "" l_utils.c base directory
"gamedir" "" l_utils.c game directory
"cddir" "" l_utils.c CD directory
"basedir" "" - base directory
"homedir" "" be_interface.c home directory
"gamedir" "" be_interface.c mod game directory
"basegame" "" be_interface.c base game directory
"log" "0" l_log.c enable/disable creating a log file
"maxclients" "4" be_interface.c maximum number of clients

View file

@ -451,6 +451,8 @@ int SV_BotLibSetup( void ) {
return -1;
}
botlib_export->BotLibVarSet( "basegame", com_basegame->string );
return botlib_export->BotLibSetup();
}