Skip to content

Commit

Permalink
Always remove bots on game end regardless of map restart, since we ar…
Browse files Browse the repository at this point in the history
…e trying to never put them on spectators now
  • Loading branch information
perturbed committed Feb 5, 2017
1 parent 6107181 commit 71b2b40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
18 changes: 7 additions & 11 deletions src/sgame/sg_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,22 +513,18 @@ void G_BotInit()
}
}

void G_BotCleanup( int restart )
void G_BotCleanup()
{
if ( !restart )
for ( int i = 0; i < MAX_CLIENTS; ++i )
{
int i;

for ( i = 0; i < MAX_CLIENTS; ++i )
if ( g_entities[i].r.svFlags & SVF_BOT && level.clients[i].pers.connected != CON_DISCONNECTED )
{
if ( g_entities[i].r.svFlags & SVF_BOT && level.clients[i].pers.connected != CON_DISCONNECTED )
{
G_BotDel( i );
}
G_BotDel( i );
}

G_BotClearNames();
}

G_BotClearNames();

FreeTreeList( &treeList );
G_BotNavCleanup();
}
2 changes: 1 addition & 1 deletion src/sgame/sg_bot.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ int G_BotAddNames(team_t team, int arg, int last);
void G_BotDisableArea( vec3_t origin, vec3_t mins, vec3_t maxs );
void G_BotEnableArea( vec3_t origin, vec3_t mins, vec3_t maxs );
void G_BotInit();
void G_BotCleanup(int restart);
void G_BotCleanup();
#endif
4 changes: 2 additions & 2 deletions src/sgame/sg_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ static bool G_VotesRunning()
G_ShutdownGame
=================
*/
void G_ShutdownGame( int restart )
void G_ShutdownGame( int /* restart */ )
{
// in case of a map_restart
G_ClearVotes( true );
Expand Down Expand Up @@ -953,7 +953,7 @@ void G_ShutdownGame( int restart )
G_WriteSessionData();

G_admin_cleanup();
G_BotCleanup( restart );
G_BotCleanup();
G_namelog_cleanup();

G_UnregisterCommands();
Expand Down

0 comments on commit 71b2b40

Please sign in to comment.