From 4cbeaa6e6471d1b830c53021f6ecc39f1f78c5e3 Mon Sep 17 00:00:00 2001 From: Unnamed Date: Sat, 27 Apr 2019 03:37:50 +0000 Subject: [PATCH] FollowBot.cpp: remove duplicate code in cm --- src/hacks/FollowBot.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 11f0374e..5fabe86a 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -237,7 +237,7 @@ static bool startFollow(CachedEntity *entity, bool useNavbot) static void cm() { - if (!enable) + if (!enable || CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer() || CE_BAD(LOCAL_W)) { follow_target = 0; if (nb::task::current_task == nb::task::followbot) @@ -247,14 +247,6 @@ static void cm() if (!inited) init(); - // We need a local player to control - if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer() || CE_BAD(LOCAL_W)) - { - follow_target = 0; - if (nb::task::current_task == nb::task::followbot) - nb::task::current_task = nb::task::none; - return; - } if (nb::task::current_task == nb::task::health || nb::task::current_task == nb::task::ammo) { follow_target = 0;