From f956909c02f16220de7a05e15d699227c7a0be06 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 22 Jul 2018 12:45:17 +0200 Subject: [PATCH] press a to be gay today --- src/hacks/FollowBot.cpp | 4 ++-- src/helpers.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 0f213ea6..b9c2b550 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -200,13 +200,13 @@ void WorldTick() if (corneractivate) { Vector indirectOrigin = - VischeckCorner(LOCAL_E, entity, 500, + VischeckCorner(LOCAL_E, entity, float(follow_activation) / 2, true); // get the corner location that the // future target is visible from std::pair corners; if (!indirectOrigin.z && entity->m_IDX == lastent) // if we couldn't find it, run wallcheck instead { - corners = VischeckWall(LOCAL_E, entity, 500, true); + corners = VischeckWall(LOCAL_E, entity, float(follow_activation) / 2, true); if (!corners.first.z || !corners.second.z) continue; addCrumbs(LOCAL_E, corners.first); diff --git a/src/helpers.cpp b/src/helpers.cpp index 79b5feb3..3e514429 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -175,7 +175,7 @@ std::pair VischeckWall(CachedEntity *player, CachedEntity *target // if we can see an entity, we don't need to run calculations if (VisCheckEntFromEnt(player, target)) { - std::pair orig(origin, origin); + std::pair orig(origin, target->m_vecOrigin()); if (!checkWalkable) return orig; else if (canReachVector(origin, target->m_vecOrigin())) @@ -234,11 +234,13 @@ std::pair VischeckWall(CachedEntity *player, CachedEntity *target continue; if (!IsVectorVisible(virtualOrigin, virtualOrigin2, true)) continue; + if (!IsVectorVisible(virtualOrigin2, target->m_vecOrigin(), true)) + continue; std::pair toret(virtualOrigin, virtualOrigin2); if (!checkWalkable) return toret; // check if the location is accessible - if (!canReachVector(origin, virtualOrigin) || !canReachVector(virtualOrigin2, virtualOrigin) || !canReachVector(target->m_vecOrigin(), virtualOrigin2)) + if (!canReachVector(origin, virtualOrigin) || !canReachVector(virtualOrigin2, virtualOrigin)) continue; if (canReachVector(virtualOrigin2, target->m_vecOrigin())) return toret;