mirror of https://github.com/ioquake/ioq3.git
Fix bot loading in case player supplied invalid bot names
This commit is contained in:
parent
de9cf465cc
commit
549f23bda6
|
@ -199,6 +199,11 @@ static void UI_SPLevelMenu_SetBots( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
botInfo = UI_GetBotInfoByName( bot );
|
botInfo = UI_GetBotInfoByName( bot );
|
||||||
|
if(!botInfo)
|
||||||
|
{
|
||||||
|
botInfo = UI_GetBotInfoByNumber( levelMenuInfo.numBots );
|
||||||
|
}
|
||||||
|
|
||||||
if( botInfo ) {
|
if( botInfo ) {
|
||||||
levelMenuInfo.botPics[levelMenuInfo.numBots] = PlayerIconHandle( Info_ValueForKey( botInfo, "model" ) );
|
levelMenuInfo.botPics[levelMenuInfo.numBots] = PlayerIconHandle( Info_ValueForKey( botInfo, "model" ) );
|
||||||
Q_strncpyz( levelMenuInfo.botNames[levelMenuInfo.numBots], Info_ValueForKey( botInfo, "name" ), 10 );
|
Q_strncpyz( levelMenuInfo.botNames[levelMenuInfo.numBots], Info_ValueForKey( botInfo, "name" ), 10 );
|
||||||
|
|
|
@ -1093,6 +1093,10 @@ static void ServerOptions_InitBotNames( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
botInfo = UI_GetBotInfoByName( bot );
|
botInfo = UI_GetBotInfoByName( bot );
|
||||||
|
if( !botInfo )
|
||||||
|
{
|
||||||
|
botInfo = UI_GetBotInfoByNumber( count );
|
||||||
|
}
|
||||||
bot = Info_ValueForKey( botInfo, "name" );
|
bot = Info_ValueForKey( botInfo, "name" );
|
||||||
|
|
||||||
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
|
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
|
||||||
|
|
Loading…
Reference in New Issue