Free bot client if cannot load bot

Introduced by commit a57a5cfd9b.
This commit is contained in:
Zack Middleton 2013-09-08 21:59:58 -05:00
parent 27ddba9c2e
commit 68a616c7f1

View file

@ -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 );