From 6f8292ce0a66e0b9e7cb5c6487181c3da616e4f0 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 24 Jun 2018 21:56:20 +0200 Subject: [PATCH] fix --- src/hacks/FollowBot.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index df8e2c2a..fa130ac3 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -10,7 +10,6 @@ #include #include #include -#include namespace hacks::shared::followbot { @@ -233,20 +232,11 @@ void WorldTick() auto tar_orig = followtar->m_vecOrigin(); auto loc_orig = LOCAL_E->m_vecOrigin(); auto dist_to_target = loc_orig.DistTo(tar_orig); - if (roambot) + + if ((dist_to_target < (float) follow_distance) && + VisCheckEntFromEnt(LOCAL_E, followtar)) { - if ((dist_to_target < (float)follow_distance) && VisCheckEntFromEnt(LOCAL_E, followtar)) - { - idle_time.update(); - } - } - else - { - if (dist_to_target < 30) - { - breadcrumbs.clear(); - idle_time.update(); - } + idle_time.update(); } // New crumbs, we add one if its empty so we have something to follow @@ -257,12 +247,6 @@ void WorldTick() // Prune old and close crumbs that we wont need anymore, update idle timer // too - while (breadcrumbs.size() > 1 && loc_orig.DistTo(breadcrumbs.at(0)) < 60.f) - { - idle_time.update(); - breadcrumbs.erase(breadcrumbs.begin()); - } - for (int i = 0; i < breadcrumbs.size(); i++) { if (loc_orig.DistTo(breadcrumbs.at(i)) < 60.f) @@ -274,11 +258,8 @@ void WorldTick() } //moved because its worthless otherwise - if (sync_taunt && HasCondition(followtar)) { - if (lastTaunt.test_and_set(1000)) - { + if (sync_taunt && HasCondition(followtar) && lastTaunt.test_and_set(1000)) { g_IEngine->ClientCmd("taunt"); - } } // Follow the crumbs when too far away, or just starting to follow