From 68a616c7f18ccd68ecf6bde0a444d6c870a10866 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 8 Sep 2013 21:59:58 -0500 Subject: [PATCH] Free bot client if cannot load bot Introduced by commit a57a5cfd9b5dcc51696777c67b275c55c5b4b452. --- code/game/g_bot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/g_bot.c b/code/game/g_bot.c index 6ee369a3..9b7714a5 100644 --- a/code/game/g_bot.c +++ b/code/game/g_bot.c @@ -580,6 +580,7 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay botinfo = G_GetBotInfoByName( name ); if ( !botinfo ) { G_Printf( S_COLOR_RED "Error: Bot '%s' not defined\n", name ); + trap_BotFreeClient( clientNum ); return; } @@ -651,6 +652,7 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay s = Info_ValueForKey(botinfo, "aifile"); if (!*s ) { trap_Print( S_COLOR_RED "Error: bot has no aifile specified\n" ); + trap_BotFreeClient( clientNum ); return; } Info_SetValueForKey( userinfo, "characterfile", s );