kero-kero-o

This commit is contained in:
Izuru Yakumo
2025-07-27 21:21:08 -03:00
parent 6de1c350d1
commit 23733acd7f

View File

@@ -1317,112 +1317,96 @@ static void ServerOptions_LevelshotDraw( void *self ) {
UI_DrawString( x, y, gametype_items[gametype_remap2[s_serveroptions.gametype]], UI_CENTER|UI_SMALLFONT, color_orange ); UI_DrawString( x, y, gametype_items[gametype_remap2[s_serveroptions.gametype]], UI_CENTER|UI_SMALLFONT, color_orange );
} }
static void ServerOptions_InitBotNames( void ) { static void ServerOptions_InitBotNames( void ) {
int count; int count;
int n; int n;
const char *arenaInfo; const char *arenaInfo;
const char *botInfo; const char *botInfo;
char *p; char *p;
char *bot; char *bot;
char bots[MAX_INFO_STRING]; char bots[MAX_INFO_STRING];
if( s_serveroptions.gametype >= GT_TEAM && s_serveroptions.gametype != GT_LMS ) { if ( s_serveroptions.gametype >= GT_TEAM ) {
Q_strncpyz( s_serveroptions.playerNameBuffers[1], "--------", 16 ); Q_strncpyz( s_serveroptions.playerNameBuffers[1], "Reimu", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[2], "--------", 16 ); Q_strncpyz( s_serveroptions.playerNameBuffers[2], "Marisa", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[3], "--------", 16 ); if ( s_serveroptions.gametype == GT_TEAM ) {
if( s_serveroptions.gametype != GT_TEAM ) { Q_strncpyz( s_serveroptions.playerNameBuffers[3], "Kosuzu", 16 );
s_serveroptions.playerType[3].curvalue = 2; } else {
} s_serveroptions.playerType[3].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[4], "--------", 16 ); }
s_serveroptions.playerType[4].curvalue = 2; s_serveroptions.playerType[4].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[5], "--------", 16 ); s_serveroptions.playerType[5].curvalue = 2;
s_serveroptions.playerType[5].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[6], "--------", 16 ); Q_strncpyz( s_serveroptions.playerNameBuffers[6], "Kanako", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[7], "--------", 16 ); Q_strncpyz( s_serveroptions.playerNameBuffers[7], "Sanae", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[8], "--------", 16 ); Q_strncpyz( s_serveroptions.playerNameBuffers[8], "Suwako", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[9], "--------", 16 ); if ( s_serveroptions.gametype == GT_TEAM ) {
if( s_serveroptions.gametype != GT_TEAM ) { Q_strncpyz( s_serveroptions.playerNameBuffers[9], "Aya", 16 );
s_serveroptions.playerType[9].curvalue = 2; } else {
} s_serveroptions.playerType[9].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[10], "--------", 16 ); }
s_serveroptions.playerType[10].curvalue = 2; s_serveroptions.playerType[10].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[11], "--------", 16 ); s_serveroptions.playerType[11].curvalue = 2;
s_serveroptions.playerType[11].curvalue = 2;
return; return;
} }
count = 1; // skip the first slot, reserved for a human // Reserve the first slot for a human
count = 1;
// Get info for this map
arenaInfo = UI_GetArenaInfoByMap( s_serveroptions.mapnamebuffer );
// get info for this map // Get the bot info, we'll seed with them if any are listed
arenaInfo = UI_GetArenaInfoByMap( s_serveroptions.mapnamebuffer ); Q_strncpyz( bots, Info_ValueForKey( arenaInfo, "bots" ), sizeof(bots) );
p = &bots[0];
while( *p && count < PLAYER_SLOTS ) {
// Skip spaces
while ( *p && *p == ' ' ) {
p++;
}
if ( !*p ) {
break;
}
// get the bot info - we'll seed with them if any are listed // Mark start of bot name
Q_strncpyz( bots, Info_ValueForKey( arenaInfo, "bots" ), sizeof(bots) ); bot = p;
p = &bots[0];
while( *p && count < PLAYER_SLOTS ) {
//skip spaces
while( *p && *p == ' ' ) {
p++;
}
if( !p ) {
break;
}
// mark start of bot name // Skip until space of null
bot = p; while ( *p && *p != ' ' ) {
p++;
}
if ( *p ) {
*p++ = 0;
}
// skip until space of null botInfo = UI_GetBotInfoByName( bot );
while( *p && *p != ' ' ) { if (!botInfo) {
p++; botInfo = UI_GetBotInfoByNumber( count );
} }
if( *p ) { bot = Info_ValueForKey( botInfo, "name" );
*p++ = 0;
}
botInfo = UI_GetBotInfoByName( bot ); Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
bot = Info_ValueForKey( botInfo, "name" ); count++;
}
if(!Q_stricmp(bot,""))
bot = "--------";
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) ); // Set the rest of bot slots to "---"
count++; for( n = count; n < PLAYER_SLOTS; n++ ) {
} strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
}
// set the rest of the bot slots to to other bots // Pad up to #8 as open slots
for( n = count; n < PLAYER_SLOTS; n++ ) { for ( ;count < 8; count++ ) {
switch(n%4){ s_serveroptions.playerType[count].curvalue = 0;
case 0: }
strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
break;
case 1:
strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
break;
case 2:
strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
break;
default:
strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
}
}
// pad up to #8 as open slots // Close off the rest by default
for( ;count < 8; count++ ) { for ( ;count < PLAYER_SLOTS; count++ ) {
s_serveroptions.playerType[count].curvalue = 0; if ( s_serveroptions.playerType[count].curvalue == 1 ) {
} s_serveroptions.playerType[count].curvalue == 2;
}
// close off the rest by default }
for( ;count < PLAYER_SLOTS; count++ ) {
if( s_serveroptions.playerType[count].curvalue == 1 ) {
s_serveroptions.playerType[count].curvalue = 2;
}
}
} }
void ServerOptions_MenuDraw( void ) { void ServerOptions_MenuDraw( void ) {
ServerOptions_UpdateMenuItems(); ServerOptions_UpdateMenuItems();
Menu_Draw( &s_serveroptions.menu ); Menu_Draw( &s_serveroptions.menu );