From c78fc5a60d44e14c0b2fe004128eff4dc240f57b Mon Sep 17 00:00:00 2001 From: jeefo Date: Thu, 1 Nov 2018 11:53:44 +0300 Subject: [PATCH] Fixed low-difficulty bot's unable to search the planted C4. --- source/navigate.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/navigate.cpp b/source/navigate.cpp index 3e47a5b..8f7b393 100644 --- a/source/navigate.cpp +++ b/source/navigate.cpp @@ -1911,10 +1911,16 @@ int Bot::getBombPoint (void) { // this function finds the best goal (bomb) waypoint for CTs when searching for a planted bomb. auto &goals = waypoints.m_goalPoints; - auto bomb = isBombAudible (); - if (goals.empty () || bomb.empty ()) { - return rng.getInt (0, waypoints.length () - 1); // reliability check + auto bomb = waypoints.getBombPos (); + auto audible = isBombAudible (); + + if (!audible.empty ()) { + m_bombSearchOverridden = true; + return waypoints.getNearest (audible, 80.0f); + } + else if (goals.empty ()) { + return waypoints.getNearest (bomb, 80.0f, FLAG_GOAL); // reliability check } // take the nearest to bomb waypoints instead of goal if close enough