=========================================================================== Parameter: - Returns: - Changes Globals: - ===========================================================================
| 139 | // Changes Globals: - |
| 140 | //=========================================================================== |
| 141 | int Export_BotLibSetup(void) |
| 142 | { |
| 143 | int errnum; |
| 144 | |
| 145 | botDeveloper = LibVarGetValue("bot_developer"); |
| 146 | memset( &botlibglobals, 0, sizeof(botlibglobals) ); // bk001207 - init |
| 147 | //initialize byte swapping (litte endian etc.) |
| 148 | // Swap_Init(); |
| 149 | |
| 150 | if(botDeveloper) |
| 151 | { |
| 152 | char *homedir, *gamedir, *basedir; |
| 153 | char logfilename[MAX_OSPATH]; |
| 154 | |
| 155 | homedir = LibVarGetString("homedir"); |
| 156 | gamedir = LibVarGetString("gamedir"); |
| 157 | basedir = LibVarGetString("com_basegame"); |
| 158 | |
| 159 | if (*homedir) |
| 160 | { |
| 161 | if(*gamedir) |
| 162 | Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP); |
| 163 | else if(*basedir) |
| 164 | Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, basedir, PATH_SEP); |
| 165 | else |
| 166 | Com_sprintf(logfilename, sizeof(logfilename), "%s%c" "base" "%cbotlib.log", homedir, PATH_SEP, PATH_SEP); //fixme use BASEGAME define |
| 167 | } |
| 168 | else |
| 169 | Com_sprintf(logfilename, sizeof(logfilename), "botlib.log"); |
| 170 | |
| 171 | Log_Open(logfilename); |
| 172 | } |
| 173 | // |
| 174 | // botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n"); |
| 175 | // |
| 176 | botlibglobals.maxclients = (int) LibVarValue("maxclients", "128"); |
| 177 | botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024"); |
| 178 | |
| 179 | errnum = AAS_Setup(); //be_aas_main.c |
| 180 | if (errnum != BLERR_NOERROR) return errnum; |
| 181 | errnum = EA_Setup(); //be_ea.c |
| 182 | if (errnum != BLERR_NOERROR) return errnum; |
| 183 | /* |
| 184 | errnum = BotSetupWeaponAI(); //be_ai_weap.c |
| 185 | if (errnum != BLERR_NOERROR)return errnum; |
| 186 | errnum = BotSetupGoalAI(); //be_ai_goal.c |
| 187 | if (errnum != BLERR_NOERROR) return errnum; |
| 188 | errnum = BotSetupChatAI(); //be_ai_chat.c |
| 189 | if (errnum != BLERR_NOERROR) return errnum; |
| 190 | errnum = BotSetupMoveAI(); //be_ai_move.c |
| 191 | if (errnum != BLERR_NOERROR) return errnum; |
| 192 | */ |
| 193 | botlibsetup = qtrue; |
| 194 | botlibglobals.botlibsetup = qtrue; |
| 195 | |
| 196 | return BLERR_NOERROR; |
| 197 | } //end of the function Export_BotLibSetup |
| 198 | //=========================================================================== |
nothing calls this directly
no test coverage detected