From 783b747d5ce2ccbe448382697d9208096ade6890 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Tue, 21 Aug 2018 18:41:30 +0200 Subject: [PATCH] Fix door closing on bot and then ignoring --- include/navparser.hpp | 10 ++++++---- src/hacks/NavBot.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/navparser.hpp b/include/navparser.hpp index e02ef230..00dc8743 100644 --- a/include/navparser.hpp +++ b/include/navparser.hpp @@ -113,10 +113,12 @@ public: } auto &pair = inactives.at(connection); - pair.second = pair.second + - (std::chrono::duration_cast( - std::chrono::system_clock::now() - timer.last) - .count()); + unsigned int newTime = std::chrono::duration_cast( + std::chrono::system_clock::now() - timer.last) + .count(); + if (pair.first == 2 && !vischeckConnection(connection)) + newTime = (newTime > 2500 ? 2500 : newTime); + pair.second = pair.second + newTime; if (pair.second >= 5000) resetPather = true; } diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp index d498a7aa..8079f98f 100644 --- a/src/hacks/NavBot.cpp +++ b/src/hacks/NavBot.cpp @@ -467,7 +467,7 @@ void CreateMove() fClampAngle(angles); current_user_cmd->viewangles = angles; current_user_cmd->buttons |= IN_ATTACK; - g_pLocalPlayer->bUseSilentAngles = true; + g_pLocalPlayer->bUseSilentAngles = false; return; } }