diff --git a/source/basecode.cpp b/source/basecode.cpp index 3d67a76..7fd53f7 100644 --- a/source/basecode.cpp +++ b/source/basecode.cpp @@ -1824,7 +1824,7 @@ void Bot::SetConditions (void) ChatterMessage (Chatter_SniperKilled); else { - switch (m_numEnemiesLeft) + switch (GetNearbyEnemiesNearPosition (pev->origin, 99999.0f)) { case 0: if (Random.Long (0, 100) < 50) @@ -3006,7 +3006,7 @@ void Bot::PeriodicThink (void) m_lastEnemy = NULL; m_lastEnemyOrigin = nullvec; } - m_timePeriodicUpdate = GetWorldTime () + 0.25f; + m_timePeriodicUpdate = GetWorldTime () + 0.5f; } void Bot::RunTask_Normal (void) @@ -5455,7 +5455,7 @@ void Bot::HandleChatterMessage (const char *tempMessage) { // this function is added to prevent engine crashes with: 'Message XX started, before message XX ended', or something. - if (FStrEq (tempMessage, "#CTs_Win") && (m_team == TEAM_CF)) + if (FStrEq (tempMessage, "#CTs_Win") && m_team == TEAM_CF) { if (g_timeRoundMid > GetWorldTime ()) ChatterMessage (Chatter_QuicklyWonTheRound); @@ -5463,7 +5463,7 @@ void Bot::HandleChatterMessage (const char *tempMessage) ChatterMessage (Chatter_WonTheRound); } - if (FStrEq (tempMessage, "#Terrorists_Win") && (m_team == TEAM_TF)) + if (FStrEq (tempMessage, "#Terrorists_Win") && m_team == TEAM_TF) { if (g_timeRoundMid > GetWorldTime ()) ChatterMessage (Chatter_QuicklyWonTheRound); diff --git a/source/interface.cpp b/source/interface.cpp index 482855f..790be7b 100644 --- a/source/interface.cpp +++ b/source/interface.cpp @@ -911,6 +911,9 @@ void GameDLLInit (void) // execute main config ServerCommand ("exec addons/yapb/conf/yapb.cfg"); + // set correct version string + yb_version.SetString (FormatBuffer ("%s.0.%u", yb_version.GetString (), GenerateBuildNumber ())); + // register fake metamod command handler if we not! under mm if (!g_isMetamod) RegisterCommand ("meta", CommandHandler_NotMM); diff --git a/source/manager.cpp b/source/manager.cpp index 9e85869..e9ba2aa 100644 --- a/source/manager.cpp +++ b/source/manager.cpp @@ -220,7 +220,7 @@ Bot *BotManager::FindOneValidAliveBot (void) for (int i = 0; i < GetMaxClients (); i++) { - if (m_bots[i] != NULL && IsAlive (m_bots[i]->GetEntity ())) + if (m_bots[i] != NULL && IsAlive (m_bots[i]->GetEntity ()) && foundBots.GetSize () < 5) foundBots.Push (i); }