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 );
}
static void ServerOptions_InitBotNames( void ) {
int count;
int n;
const char *arenaInfo;
const char *botInfo;
char *p;
char *bot;
char bots[MAX_INFO_STRING];
int count;
int n;
const char *arenaInfo;
const char *botInfo;
char *p;
char *bot;
char bots[MAX_INFO_STRING];
if( s_serveroptions.gametype >= GT_TEAM && s_serveroptions.gametype != GT_LMS ) {
Q_strncpyz( s_serveroptions.playerNameBuffers[1], "--------", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[2], "--------", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[3], "--------", 16 );
if( s_serveroptions.gametype != GT_TEAM ) {
s_serveroptions.playerType[3].curvalue = 2;
}
Q_strncpyz( s_serveroptions.playerNameBuffers[4], "--------", 16 );
s_serveroptions.playerType[4].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[5], "--------", 16 );
s_serveroptions.playerType[5].curvalue = 2;
if ( s_serveroptions.gametype >= GT_TEAM ) {
Q_strncpyz( s_serveroptions.playerNameBuffers[1], "Reimu", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[2], "Marisa", 16 );
if ( s_serveroptions.gametype == GT_TEAM ) {
Q_strncpyz( s_serveroptions.playerNameBuffers[3], "Kosuzu", 16 );
} else {
s_serveroptions.playerType[3].curvalue = 2;
}
s_serveroptions.playerType[4].curvalue = 2;
s_serveroptions.playerType[5].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[6], "--------", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[7], "--------", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[8], "--------", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[9], "--------", 16 );
if( s_serveroptions.gametype != GT_TEAM ) {
s_serveroptions.playerType[9].curvalue = 2;
}
Q_strncpyz( s_serveroptions.playerNameBuffers[10], "--------", 16 );
s_serveroptions.playerType[10].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[11], "--------", 16 );
s_serveroptions.playerType[11].curvalue = 2;
Q_strncpyz( s_serveroptions.playerNameBuffers[6], "Kanako", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[7], "Sanae", 16 );
Q_strncpyz( s_serveroptions.playerNameBuffers[8], "Suwako", 16 );
if ( s_serveroptions.gametype == GT_TEAM ) {
Q_strncpyz( s_serveroptions.playerNameBuffers[9], "Aya", 16 );
} else {
s_serveroptions.playerType[9].curvalue = 2;
}
s_serveroptions.playerType[10].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
arenaInfo = UI_GetArenaInfoByMap( s_serveroptions.mapnamebuffer );
// Get the bot info, we'll seed with them if any are listed
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
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;
}
// Mark start of bot name
bot = p;
// mark start of bot name
bot = p;
// Skip until space of null
while ( *p && *p != ' ' ) {
p++;
}
if ( *p ) {
*p++ = 0;
}
// skip until space of null
while( *p && *p != ' ' ) {
p++;
}
if( *p ) {
*p++ = 0;
}
botInfo = UI_GetBotInfoByName( bot );
if (!botInfo) {
botInfo = UI_GetBotInfoByNumber( count );
}
bot = Info_ValueForKey( botInfo, "name" );
botInfo = UI_GetBotInfoByName( bot );
bot = Info_ValueForKey( botInfo, "name" );
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
count++;
}
if(!Q_stricmp(bot,""))
bot = "--------";
// Set the rest of bot slots to "---"
for( n = count; n < PLAYER_SLOTS; n++ ) {
strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
}
Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
count++;
}
// Pad up to #8 as open slots
for ( ;count < 8; count++ ) {
s_serveroptions.playerType[count].curvalue = 0;
}
// set the rest of the bot slots to to other bots
for( n = count; n < PLAYER_SLOTS; n++ ) {
switch(n%4){
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
for( ;count < 8; count++ ) {
s_serveroptions.playerType[count].curvalue = 0;
}
// close off the rest by default
for( ;count < PLAYER_SLOTS; count++ ) {
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 ) {
ServerOptions_UpdateMenuItems();
Menu_Draw( &s_serveroptions.menu );