From 65884329dc836aec78a0bed9be0d07701054cd39 Mon Sep 17 00:00:00 2001 From: commandcobra7 <91374215+commandcobra7@users.noreply.github.com> Date: Sun, 27 Nov 2022 05:08:38 +0300 Subject: [PATCH] ai::some tweaks to bot behavior. (#386) desire: disable hunting desires if bots are now vip or have hostages. bot: disallow item acquisition if we have a visible enemy. --- src/botlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index 945b6c9..09466e0 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -520,7 +520,7 @@ void Bot::updatePickups () { // this function finds Items to collect or use in the near of a bot // don't try to pickup anything while on ladder or trying to escape from bomb... - if (isOnLadder () || getCurrentTaskId () == Task::EscapeFromBomb || !cv_pickup_best.bool_ () || cv_jasonmode.bool_ () || !bots.hasIntrestingEntities ()) { + if (isOnLadder () || getCurrentTaskId () == Task::EscapeFromBomb || !cv_pickup_best.bool_ () || cv_jasonmode.bool_ () || m_seeEnemyTime + 5.0f > game.time () || !game.isNullEntity (m_enemy) || !bots.hasIntrestingEntities ()) { m_pickupItem = nullptr; m_pickupType = Pickup::None; @@ -2003,7 +2003,7 @@ void Bot::filterTasks () { } // if half of the round is over, allow hunting - if (getCurrentTaskId () != Task::EscapeFromBomb && game.isNullEntity (m_enemy) && bots.getRoundMidTime () < game.time () && !m_isUsingGrenade && m_currentNodeIndex != graph.getNearest (m_lastEnemyOrigin) && m_personality != Personality::Careful && !cv_ignore_enemies.bool_ ()) { + if (getCurrentTaskId () != Task::EscapeFromBomb && game.isNullEntity (m_enemy) && !m_isVIP && bots.getRoundMidTime () < game.time () && !hasHostage () && !m_isUsingGrenade && m_currentNodeIndex != graph.getNearest (m_lastEnemyOrigin) && m_personality != Personality::Careful && !cv_ignore_enemies.bool_ ()) { float desireLevel = 4096.0f - ((1.0f - tempAgression) * m_lastEnemyOrigin.distance (pev->origin)); desireLevel = (100.0f * desireLevel) / 4096.0f;