Browse Source

Merge pull request #10 from YGGverse/respawn-bots-configured-2

Respawn bots configured 2
bot10-yggverse bot10-yggverse-1.1.0
d47081 10 months ago committed by GitHub
parent
commit
38ca7f9395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dlls/bot/bot.cpp
  2. 8
      dlls/client.cpp

2
dlls/bot/bot.cpp

@ -1771,7 +1771,7 @@ void CBot::BotThink( void ) @@ -1771,7 +1771,7 @@ void CBot::BotThink( void )
pev->deadflag = DEAD_DEAD; // make the kicked bot be dead
bot_respawn[respawn_index].is_used = FALSE; // this slot is now free
bot_respawn[respawn_index].state = BOT_IDLE;
respawn_index = -1; // indicate no slot used
// fall through to next if statement (respawn_index will be -1)

8
dlls/client.cpp

@ -127,7 +127,7 @@ BOOL ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddres @@ -127,7 +127,7 @@ BOOL ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddres
sprintf( cmd, "kick \"%s\"\n", bot_respawn[i].name );
bot_respawn[i].state = BOT_IDLE;
bot_respawn[i].state = BOT_NEED_TO_RESPAWN;
SERVER_COMMAND( cmd ); // kick the bot using (kick "name")
break;
@ -1372,10 +1372,10 @@ void StartFrame( void ) @@ -1372,10 +1372,10 @@ void StartFrame( void )
{
for( i = 0; i < 32; i++ )
{
if( !bot_respawn[i].is_used && bot_respawn[i].state == BOT_IDLE)
if( !bot_respawn[i].is_used && bot_respawn[i].state == BOT_NEED_TO_RESPAWN)
{
bot_respawn[i].state = BOT_IS_RESPAWNING;
bot_respawn[i].is_used = FALSE; // free up this slot
bot_respawn[index].state = BOT_IS_RESPAWNING;
bot_respawn[index].is_used = FALSE; // free up this slot
BotCreate( bot_respawn[i].skin, bot_respawn[i].name, bot_respawn[i].skill );

Loading…
Cancel
Save