Fix bot loading in case player supplied invalid bot names

This commit is contained in:
Thilo Schulz committed 2009-10-06 14:17:12 +00:00
1 parent de9cf465cc
commit 549f23bda6
2 files changed
+11 -2

No files matched your search

+6 -1
View File
@@ -198,7 +198,12 @@ static void UI_SPLevelMenu_SetBots( void ) {
*p++ = 0;
}
botInfo = UI_GetBotInfoByName( bot );
botInfo = UI_GetBotInfoByName( bot );
if(!botInfo)
{
botInfo = UI_GetBotInfoByNumber( levelMenuInfo.numBots );
}
if( botInfo ) {
levelMenuInfo.botPics[levelMenuInfo.numBots] = PlayerIconHandle( Info_ValueForKey( botInfo, "model" ) );
Q_strncpyz( levelMenuInfo.botNames[levelMenuInfo.numBots], Info_ValueForKey( botInfo, "name" ), 10 );
+5 -1
View File
@@ -1092,7 +1092,11 @@ static void ServerOptions_InitBotNames( void ) {
*p++ = 0;
}
botInfo = UI_GetBotInfoByName( bot );
botInfo = UI_GetBotInfoByName( bot );
if( !botInfo )
{
botInfo = UI_GetBotInfoByNumber( count );
}
bot = Info_ValueForKey( botInfo, "name" );
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );