diff --git a/dlls/client.cpp b/dlls/client.cpp index 65f9e6e8..7175ce78 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -1368,23 +1368,26 @@ void StartFrame( void ) // if there are currently less than the maximum number of "players" // then add another bot using the default skill level... - if( ( count < max_bots ) && ( gpGlobals->time >= respawn_time ) ) + if( count < max_bots ) { for( i = 0; i < 32; i++ ) { - if( !bot_respawn[i].is_used && bot_respawn[i].state == BOT_NEED_TO_RESPAWN) + if( !bot_respawn[i].is_used && + bot_respawn[i].state == BOT_NEED_TO_RESPAWN && + gpGlobals->time >= respawn_time) { bot_respawn[i].state = BOT_IS_RESPAWNING; bot_respawn[i].is_used = FALSE; // free up this slot BotCreate( bot_respawn[i].skin, bot_respawn[i].name, bot_respawn[i].skill ); - respawn_time = gpGlobals->time + 1.0; // set next respawn time + respawn_time = gpGlobals->time + 1.0; // set next respawn time (to prevent server crash) break; } } } } + } previous_time = gpGlobals->time; // keep track of last time in StartFrame() // END BOT