/* ============== BotAIShutdown ============== */ int BotAIShutdown( int restart ) { int i; //if the game is restarted for a tournament if ( restart ) { //shutdown all the bots in the botlib for (i = 0; i < level.maxplayers; i++) { if (botstates[i] && botstates[i]->inuse) { BotAIShutdownPlayer(botstates[i]->playernum, restart); } } //don't shutdown the bot library } else { trap_BotLibShutdown(); } // BotShutdownCharacters(); //ai_char.c BotShutdownMoveAI(); //ai_move.c BotShutdownGoalAI(); //ai_goal.c BotShutdownWeaponAI(); //ai_weap.c BotShutdownWeights(); //ai_weight.c BotShutdownChatAI(); //ai_chat_sys.c //shut down bot elemantary actions EA_Shutdown(); return qtrue; }
int BotLibShutdown() { if ( !IsBotLibSetup( "BotLibShutdown" ) ) { return BLERR_LIBRARYNOTSETUP; } // shutdown all AI subsystems BotShutdownChatAI(); //be_ai_chat.c BotShutdownMoveAI(); //be_ai_move.c BotShutdownGoalAI(); //be_ai_goal.c BotShutdownWeaponAI(); //be_ai_weap.c BotShutdownWeights(); //be_ai_weight.c BotShutdownCharacters(); //be_ai_char.c // shut down aas AAS_Shutdown(); // shut down bot elemantary actions EA_Shutdown(); // free all libvars LibVarDeAllocAll(); // remove all global defines from the pre compiler PC_RemoveAllGlobalDefines(); // shut down library log file Log_Shutdown(); botlibsetup = false; botlibglobals.botlibsetup = false; // print any files still open PC_CheckOpenSourceHandles(); return BLERR_NOERROR; }
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int Export_BotLibShutdown( void ) { static int recursive = 0; if ( !BotLibSetup( "BotLibShutdown" ) ) { return BLERR_LIBRARYNOTSETUP; } // if ( recursive ) { return BLERR_NOERROR; } recursive = 1; // shutdown all AI subsystems BotShutdownChatAI(); //be_ai_chat.c BotShutdownMoveAI(); //be_ai_move.c BotShutdownGoalAI(); //be_ai_goal.c BotShutdownWeaponAI(); //be_ai_weap.c BotShutdownWeights(); //be_ai_weight.c BotShutdownCharacters(); //be_ai_char.c // shutdown AAS AAS_Shutdown(); // shutdown bot elemantary actions EA_Shutdown(); // free all libvars LibVarDeAllocAll(); // remove all global defines from the pre compiler PC_RemoveAllGlobalDefines(); // shut down library log file Log_Shutdown(); // botlibsetup = qfalse; botlibglobals.botlibsetup = qfalse; recursive = 0; // print any files still open PC_CheckOpenSourceHandles(); // #ifdef _DEBUG Log_AlwaysOpen( "memory.log" ); PrintMemoryLabels(); Log_Shutdown(); #endif return BLERR_NOERROR; } //end of the function Export_BotLibShutdown
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int Export_BotLibShutdown(void) { if (!BotLibSetup("BotLibShutdown")) return BLERR_LIBRARYNOTSETUP; #ifndef DEMO //DumpFileCRCs(); #endif //DEMO // BotShutdownChatAI(); //be_ai_chat.c BotShutdownMoveAI(); //be_ai_move.c BotShutdownGoalAI(); //be_ai_goal.c BotShutdownWeaponAI(); //be_ai_weap.c BotShutdownWeights(); //be_ai_weight.c BotShutdownCharacters(); //be_ai_char.c //shud down aas AAS_Shutdown(); //shut down bot elemantary actions EA_Shutdown(); //free all libvars LibVarDeAllocAll(); //remove all global defines from the pre compiler PC_RemoveAllGlobalDefines(); //dump all allocated memory // DumpMemory(); #ifdef DEBUG PrintMemoryLabels(); #endif //shut down library log file Log_Shutdown(); // botlibsetup = qfalse; botlibglobals.botlibsetup = qfalse; // print any files still open PC_CheckOpenSourceHandles(); // return BLERR_NOERROR; } //end of the function Export_BotLibShutdown