diff --git a/include/hacks/FollowBot.hpp b/include/hacks/FollowBot.hpp index dc66fe85..7509eb3b 100644 --- a/include/hacks/FollowBot.hpp +++ b/include/hacks/FollowBot.hpp @@ -19,4 +19,5 @@ extern CatCommand follow_steam; extern unsigned steamid; void DrawTick(); void WorldTick(); +int ClassPriority(CachedEntity* ent); } diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index 183254e4..4e597798 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -311,7 +311,7 @@ void DoResistSwitching() int force_healing_target{ 0 }; static CatCommand heal_steamid( "autoheal_heal_steamid", - "Heals a player with SteamID (ONCE. Use for easy airstuck med setup)", + "Heals a player with SteamID", [](const CCommand &args) { if (args.ArgC() < 2) { @@ -434,7 +434,6 @@ void CreateMove() GetHitbox(target, 7, out); AimAt(g_pLocalPlayer->v_Eye, out, g_pUserCmd); g_pUserCmd->buttons |= IN_ATTACK; - force_healing_target = 0; } } if (!enabled) @@ -553,19 +552,20 @@ int HealingPriority(int idx) int overheal = maxoverheal - (maxbuffedhealth - health); float overhealp = ((float) overheal / (float) maxoverheal); float healthp = ((float) health / (float) maxhealth); + priority += hacks::shared::followbot::ClassPriority(ent) * 10; switch (playerlist::AccessData(ent).state) { case playerlist::k_EState::FRIEND: priority += 70 * (1 - healthp); - priority += 15 * (1 - overhealp); + priority += 5 * (1 - overhealp); break; case playerlist::k_EState::IPC: priority += 100 * (1 - healthp); - priority += 20 * (1 - overhealp); + priority += 10 * (1 - overhealp); break; default: - priority += 50 * (1 - healthp); - priority += 10 * (1 - overhealp); + priority += 40 * (1 - healthp); + priority += 3 * (1 - overhealp); } #if ENABLE_IPC if (ipc::peer) @@ -573,7 +573,7 @@ int HealingPriority(int idx) if (hacks::shared::followbot::followbot && hacks::shared::followbot::follow_target == idx) { - priority *= 3.0f; + priority *= 6.0f; } } #endif diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index b596c288..1f0bbc86 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -120,7 +120,7 @@ void Update() { if (autojoin_team and UnassignedTeam()) { - hack::ExecuteCommand("jointeam auto"); + hack::ExecuteCommand("autoteam"); } else if (preferred_class and UnassignedClass()) { diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 7e0cae1b..f28e75f6 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -149,7 +149,32 @@ bool addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin) } return false; } - +int ClassPriority(CachedEntity* ent) +{ + switch (g_pPlayerResource->GetClass(ent)) + { + if (g_pPlayerResource->GetClass(ent) == tf_spy) + return 0; + case tf_engineer: + return 1; + case tf_medic: + return 2; + case tf_pyro: + return 3; + case tf_scout: + return 4; + case tf_sniper: + return 5; + case tf_demoman: + return 6; + case tf_soldier: + return 7; + case tf_heavy: + return 8; + default: + return 0; + } +} void WorldTick() { if (!followbot) @@ -197,7 +222,6 @@ void WorldTick() continue; if (steamid != entity->player_info.friendsID) // steamid check continue; - logging::Info("Success"); if (!entity->m_bAlivePlayer()) // Dont follow dead players continue; @@ -220,7 +244,7 @@ void WorldTick() } // If we dont have a follow target from that, we look again for someone // else who is suitable - if ((!follow_target || change) && roambot) + if ((!follow_target || change || ClassPriority(ENTITY(follow_target)) < 6) && roambot) { // Try to get a new target auto ent_count = HIGHEST_ENTITY; @@ -278,7 +302,11 @@ void WorldTick() if (follow_target && ENTITY(follow_target)->m_flDistance() > entity->m_flDistance()) // favor closer entitys - continue; + { + if (ClassPriority(ENTITY(follow_target)) > ClassPriority(entity)) + continue; + } + // ooooo, a target follow_target = i; afkTicks[i].update(); // set afk time to 0 diff --git a/src/hacks/UberSpam.cpp b/src/hacks/UberSpam.cpp index e27346a3..e487f583 100755 --- a/src/hacks/UberSpam.cpp +++ b/src/hacks/UberSpam.cpp @@ -125,9 +125,9 @@ const std::vector builtin_cathook = { "-> I am charged!", "-> Not a step back! UBERCHARGE USED!", "-> My Ubercharge comes to an end!", - "-> I have a bit of ubercharge!", + "-> I have %i%% of ubercharge!", "-> I have half of the ubercharge!", - "-> Ubercharge almost ready!" + "-> Ubercharge almost ready! (%i%%)" }; const std::vector builtin_nonecore = { ">>> GET READY TO RUMBLE! <<<", ">>> CHEATS ACTIVATED! <<<", diff --git a/src/helpers.cpp b/src/helpers.cpp index 9cdb1243..0392dae2 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -144,7 +144,8 @@ Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist) if (VisCheckEntFromEntVector( virtualOrigin, player, target)) // check if the virtualOrigin can see the target - return virtualOrigin; // return the corner position that we know + if (abs(player->m_vecOrigin().z - virtualOrigin.z) < 400) // check for accidental height tracers + return virtualOrigin; // return the corner position that we know // can see the target } }