[quake3-commits] r1645 - trunk/code/q3_ui
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Oct 6 10:17:13 EDT 2009
Author: thilo
Date: 2009-10-06 10:17:12 -0400 (Tue, 06 Oct 2009)
New Revision: 1645
Modified:
trunk/code/q3_ui/ui_splevel.c
trunk/code/q3_ui/ui_startserver.c
Log:
Fix bot loading in case player supplied invalid bot names
Modified: trunk/code/q3_ui/ui_splevel.c
===================================================================
--- trunk/code/q3_ui/ui_splevel.c 2009-10-06 14:10:45 UTC (rev 1644)
+++ trunk/code/q3_ui/ui_splevel.c 2009-10-06 14:17:12 UTC (rev 1645)
@@ -198,7 +198,12 @@
*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 );
Modified: trunk/code/q3_ui/ui_startserver.c
===================================================================
--- trunk/code/q3_ui/ui_startserver.c 2009-10-06 14:10:45 UTC (rev 1644)
+++ trunk/code/q3_ui/ui_startserver.c 2009-10-06 14:17:12 UTC (rev 1645)
@@ -1092,7 +1092,11 @@
*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]) );
More information about the quake3-commits
mailing list