Start Converting CreateMove's
This commit is contained in:
parent
d4bc116a57
commit
86f854dac6
@ -9,7 +9,6 @@
|
||||
#include "common.hpp"
|
||||
namespace hacks::shared::autojoin
|
||||
{
|
||||
void update();
|
||||
void updateSearch();
|
||||
void onShutdown();
|
||||
} // namespace hacks::shared::autojoin
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
void Init();
|
||||
extern std::array<ESPData, 2048> data;
|
||||
|
||||
void CreateMove();
|
||||
void Draw();
|
||||
|
||||
// Entity Processing
|
||||
|
@ -11,7 +11,6 @@ namespace hacks::shared::followbot
|
||||
{
|
||||
|
||||
void DrawTick();
|
||||
void WorldTick();
|
||||
int ClassPriority(CachedEntity *ent);
|
||||
|
||||
bool isEnabled();
|
||||
|
@ -9,5 +9,4 @@ namespace hacks::tf2::NavBot
|
||||
{
|
||||
void Init();
|
||||
void initonce();
|
||||
void CreateMove();
|
||||
} // namespace hacks::tf2::NavBot
|
@ -16,6 +16,5 @@ void Initialize();
|
||||
#if ENABLE_VISUALS
|
||||
void Draw();
|
||||
#endif
|
||||
void Move();
|
||||
void OnLevelInit();
|
||||
} // namespace hacks::shared::walkbot
|
||||
|
@ -9,5 +9,4 @@
|
||||
|
||||
class CachedEntity;
|
||||
|
||||
void UpdateHoovyList();
|
||||
bool IsHoovy(CachedEntity *entity);
|
||||
|
@ -22,7 +22,6 @@ bool NavTo(Vector dest, bool navToLocalCenter = true, bool persistent = true,
|
||||
void clearInstructions();
|
||||
int findClosestNavSquare(Vector vec);
|
||||
bool Prepare();
|
||||
void CreateMove();
|
||||
void Draw();
|
||||
|
||||
int FindInVector(size_t id);
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <settings/Int.hpp>
|
||||
#include "HookTools.hpp"
|
||||
#include <hacks/AutoJoin.hpp>
|
||||
|
||||
#include "common.hpp"
|
||||
@ -157,9 +158,8 @@ void updateSearch()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void update()
|
||||
{
|
||||
static HookedFunction
|
||||
update(HookedFunctions_types::HF_CreateMove, "Autojoin", 1, []() {
|
||||
#if !LAGBOT_MODE
|
||||
if (autoteam_timer.test_and_set(500))
|
||||
{
|
||||
@ -171,12 +171,13 @@ void update()
|
||||
{
|
||||
if (int(autojoin_class) < 10)
|
||||
g_IEngine->ExecuteClientCmd(
|
||||
format("join_class ", classnames[int(autojoin_class) - 1])
|
||||
format("join_class ",
|
||||
classnames[int(autojoin_class) - 1])
|
||||
.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
});
|
||||
|
||||
void onShutdown()
|
||||
{
|
||||
|
@ -247,22 +247,24 @@ void Draw()
|
||||
}
|
||||
|
||||
// Function called on create move
|
||||
void CreateMove()
|
||||
{
|
||||
|
||||
static HookedFunction
|
||||
CreateMove(HookedFunctions_types::HF_CreateMove, "ESP", 18, []() {
|
||||
// Check usersettings if enabled
|
||||
if (!*enable)
|
||||
return;
|
||||
|
||||
if (CE_BAD(LOCAL_E))
|
||||
return;
|
||||
// Something
|
||||
std::lock_guard<std::mutex> esp_lock(threadsafe_mutex);
|
||||
|
||||
ResetEntityStrings(); // Clear any strings entities have
|
||||
entities_need_repaint.clear(); // Clear data on entities that need redraw
|
||||
entities_need_repaint
|
||||
.clear(); // Clear data on entities that need redraw
|
||||
int max_clients = g_IEngine->GetMaxClients();
|
||||
int limit = HIGHEST_ENTITY;
|
||||
|
||||
// If not using any other special esp, we lower the min to the max clients
|
||||
// If not using any other special esp, we lower the min to the max
|
||||
// clients
|
||||
if (!buildings && !proj_esp && !item_esp)
|
||||
limit = std::min(max_clients, HIGHEST_ENTITY);
|
||||
|
||||
@ -290,8 +292,8 @@ void CreateMove()
|
||||
if (show_distance)
|
||||
{
|
||||
AddEntityString(
|
||||
ent,
|
||||
format((int) (ENTITY(i)->m_flDistance() / 64 * 1.22f),
|
||||
ent, format((int) (ENTITY(i)->m_flDistance() / 64 *
|
||||
1.22f),
|
||||
'm'));
|
||||
}
|
||||
}
|
||||
@ -304,7 +306,7 @@ void CreateMove()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static glez::texture atlas{ DATA_PATH "/textures/atlas.png" };
|
||||
static glez::texture idspec{ DATA_PATH "/textures/idspec.png" };
|
||||
|
@ -168,8 +168,9 @@ int ClassPriority(CachedEntity *ent)
|
||||
}
|
||||
Timer waittime{};
|
||||
int lastent = 0;
|
||||
void WorldTick()
|
||||
{
|
||||
#if ENABLE_IPC
|
||||
static HookedFunction
|
||||
WorldTick(HookedFunctions_types::HF_CreateMove, "followbot", 20, []() {
|
||||
if (!enable)
|
||||
{
|
||||
follow_target = 0;
|
||||
@ -222,8 +223,8 @@ void WorldTick()
|
||||
continue;
|
||||
if (corneractivate)
|
||||
{
|
||||
Vector indirectOrigin =
|
||||
VischeckCorner(LOCAL_E, entity, *follow_activation / 2,
|
||||
Vector indirectOrigin = VischeckCorner(
|
||||
LOCAL_E, entity, *follow_activation / 2,
|
||||
true); // get the corner location that the
|
||||
// future target is visible from
|
||||
std::pair<Vector, Vector> corners;
|
||||
@ -231,7 +232,8 @@ void WorldTick()
|
||||
entity->m_IDX == lastent) // if we couldn't find it, run
|
||||
// wallcheck instead
|
||||
{
|
||||
corners = VischeckWall(LOCAL_E, entity,
|
||||
corners =
|
||||
VischeckWall(LOCAL_E, entity,
|
||||
float(follow_activation) / 2, true);
|
||||
if (!corners.first.z || !corners.second.z)
|
||||
continue;
|
||||
@ -276,8 +278,8 @@ void WorldTick()
|
||||
if (entity->m_bEnemy())
|
||||
continue;
|
||||
if (afk &&
|
||||
afkTicks[i].check(int(
|
||||
afktime))) // don't follow target that was determined afk
|
||||
afkTicks[i].check(int(afktime))) // don't follow target that
|
||||
// was determined afk
|
||||
continue;
|
||||
if (IsPlayerDisguised(entity) || IsPlayerInvisible(entity))
|
||||
continue;
|
||||
@ -313,8 +315,8 @@ void WorldTick()
|
||||
|
||||
if (corneractivate)
|
||||
{
|
||||
Vector indirectOrigin =
|
||||
VischeckCorner(LOCAL_E, entity, 250,
|
||||
Vector indirectOrigin = VischeckCorner(
|
||||
LOCAL_E, entity, 250,
|
||||
true); // get the corner location that the
|
||||
// future target is visible from
|
||||
std::pair<Vector, Vector> corners;
|
||||
@ -397,8 +399,8 @@ void WorldTick()
|
||||
DistanceToGround(ENTITY(follow_target)) < 45)
|
||||
breadcrumbs.push_back(tar_orig);
|
||||
|
||||
// Prune old and close crumbs that we wont need anymore, update idle timer
|
||||
// too
|
||||
// Prune old and close crumbs that we wont need anymore, update idle
|
||||
// timer too
|
||||
for (int i = 0; i < breadcrumbs.size(); i++)
|
||||
{
|
||||
if (loc_orig.DistTo(breadcrumbs.at(i)) < 60.f)
|
||||
@ -430,7 +432,8 @@ void WorldTick()
|
||||
}
|
||||
// Check if still moving. 70 HU = Sniper Zoomed Speed
|
||||
if (idle_time.check(3000) &&
|
||||
CE_VECTOR(g_pLocalPlayer->entity, netvar.vVelocity).IsZero(60.0f))
|
||||
CE_VECTOR(g_pLocalPlayer->entity, netvar.vVelocity)
|
||||
.IsZero(60.0f))
|
||||
{
|
||||
follow_target = 0;
|
||||
return;
|
||||
@ -456,7 +459,8 @@ void WorldTick()
|
||||
|
||||
// Get the follow targets active weapon
|
||||
int owner_weapon_eid =
|
||||
(CE_INT(ENTITY(follow_target), netvar.hActiveWeapon) & 0xFFF);
|
||||
(CE_INT(ENTITY(follow_target), netvar.hActiveWeapon) &
|
||||
0xFFF);
|
||||
IClientEntity *owner_weapon =
|
||||
g_IEntityList->GetClientEntity(owner_weapon_eid);
|
||||
|
||||
@ -469,7 +473,8 @@ void WorldTick()
|
||||
// IsBaseCombatWeapon()
|
||||
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(
|
||||
RAW_ENT(g_pLocalPlayer->weapon())) &&
|
||||
re::C_BaseCombatWeapon::IsBaseCombatWeapon(owner_weapon))
|
||||
re::C_BaseCombatWeapon::IsBaseCombatWeapon(
|
||||
owner_weapon))
|
||||
{
|
||||
|
||||
// Get the players slot numbers and store in some vars
|
||||
@ -478,9 +483,8 @@ void WorldTick()
|
||||
int owner_slot =
|
||||
re::C_BaseCombatWeapon::GetSlot(owner_weapon);
|
||||
|
||||
// If the local player is a medic and user settings allow,
|
||||
// then
|
||||
// keep the medigun out
|
||||
// If the local player is a medic and user settings
|
||||
// allow, then keep the medigun out
|
||||
if (g_pLocalPlayer->clazz == tf_medic && always_medigun)
|
||||
{
|
||||
if (my_slot != 1)
|
||||
@ -488,9 +492,8 @@ void WorldTick()
|
||||
g_IEngine->ExecuteClientCmd("slot2");
|
||||
}
|
||||
|
||||
// Else we attemt to keep our weapon mimiced with our
|
||||
// follow
|
||||
// target
|
||||
// Else we attemt to keep our weapon mimiced with
|
||||
// our follow target
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -507,8 +510,8 @@ void WorldTick()
|
||||
}
|
||||
else
|
||||
idle_time.update();
|
||||
}
|
||||
|
||||
});
|
||||
#endif
|
||||
void DrawTick()
|
||||
{
|
||||
#if ENABLE_VISUALS
|
||||
|
@ -436,9 +436,10 @@ CatCommand debug_tele("navbot_debug", "debug", []() {
|
||||
CE_FLOAT(ent, netvar.m_flTeleYawToExit), g_GlobalVars->curtime,
|
||||
g_GlobalVars->curtime * g_GlobalVars->interval_per_tick);
|
||||
});
|
||||
|
||||
int follow_target = 0;
|
||||
void CreateMove()
|
||||
{
|
||||
static HookedFunction
|
||||
CreateMove(HookedFunctions_types::HF_CreateMove, "NavBot", 16, []() {
|
||||
if ((!enable && !enable_fb) || !nav::Prepare())
|
||||
return;
|
||||
if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer())
|
||||
@ -471,7 +472,8 @@ void CreateMove()
|
||||
if ((!HasLowHealth() && nav::priority == 7) ||
|
||||
(!HasLowAmmo() && nav::priority == 6))
|
||||
nav::clearInstructions();
|
||||
static int waittime = (spy_mode || heavy_mode || engi_mode) ? 100 : 2000;
|
||||
static int waittime =
|
||||
(spy_mode || heavy_mode || engi_mode) ? 100 : 2000;
|
||||
if (*take_tele)
|
||||
{
|
||||
int idx = GetClosestTeleporter();
|
||||
@ -493,7 +495,8 @@ void CreateMove()
|
||||
}
|
||||
if (enable)
|
||||
{
|
||||
if (!nav::ReadyForCommands && !spy_mode && !heavy_mode && !engi_mode)
|
||||
if (!nav::ReadyForCommands && !spy_mode && !heavy_mode &&
|
||||
!engi_mode)
|
||||
cd3.update();
|
||||
if (target_sentry && NavToSentry(3))
|
||||
return;
|
||||
@ -533,10 +536,11 @@ void CreateMove()
|
||||
{
|
||||
int bestscr = INT_MAX;
|
||||
hacks::shared::backtrack::BacktrackData besttick{};
|
||||
for (auto i : hacks::shared::backtrack::headPositions
|
||||
[tar->m_IDX])
|
||||
for (auto i : hacks::shared::backtrack::
|
||||
headPositions[tar->m_IDX])
|
||||
{
|
||||
if (!hacks::shared::backtrack::ValidTick(i, tar))
|
||||
if (!hacks::shared::backtrack::ValidTick(i,
|
||||
tar))
|
||||
{
|
||||
int scr = i.tickcount;
|
||||
if (scr < bestscr)
|
||||
@ -562,7 +566,8 @@ void CreateMove()
|
||||
// If No spots set just return
|
||||
if (nest_spots.empty())
|
||||
return;
|
||||
// Get Metal (offset of MAX metal is +8 and current metal +12)
|
||||
// Get Metal (offset of MAX metal is +8 and current metal
|
||||
// +12)
|
||||
int metal = CE_INT(LOCAL_E, netvar.m_iAmmo + 12);
|
||||
// Best spot storage
|
||||
static Vector best_spot{};
|
||||
@ -599,7 +604,8 @@ void CreateMove()
|
||||
{
|
||||
CachedEntity *ent = ENTITY(ClosestBuilding);
|
||||
// If we have more than 25 metal and the building is
|
||||
// damaged or not fully upgraded hit it with the wrench
|
||||
// damaged or not fully upgraded hit it with the
|
||||
// wrench
|
||||
if (metal > 25 &&
|
||||
(CE_INT(ent, netvar.iUpgradeLevel) < 3 ||
|
||||
CE_INT(ent, netvar.iBuildingHealth) <
|
||||
@ -622,9 +628,12 @@ void CreateMove()
|
||||
re::C_TFWeaponBaseMelee::GetSwingRange(
|
||||
RAW_ENT(LOCAL_W)))
|
||||
{
|
||||
float minf = min.DistTo(g_pLocalPlayer->v_Eye);
|
||||
float maxf = max.DistTo(g_pLocalPlayer->v_Eye);
|
||||
float center = GetBuildingPosition(ent).DistTo(
|
||||
float minf =
|
||||
min.DistTo(g_pLocalPlayer->v_Eye);
|
||||
float maxf =
|
||||
max.DistTo(g_pLocalPlayer->v_Eye);
|
||||
float center =
|
||||
GetBuildingPosition(ent).DistTo(
|
||||
g_pLocalPlayer->v_Eye);
|
||||
float closest =
|
||||
fminf(minf, fminf(maxf, center));
|
||||
@ -660,7 +669,8 @@ void CreateMove()
|
||||
return;
|
||||
}
|
||||
// Ammo is dormant, go and find it!
|
||||
else if (sniper_spots.size() && nav::ReadyForCommands)
|
||||
else if (sniper_spots.size() &&
|
||||
nav::ReadyForCommands)
|
||||
{
|
||||
if (cd2.test_and_set(5000))
|
||||
Init();
|
||||
@ -675,10 +685,11 @@ void CreateMove()
|
||||
// Make ENgi look slightly down
|
||||
current_user_cmd->viewangles.x = 20.0f;
|
||||
// Build buildings in a 360° angle around player
|
||||
current_user_cmd->viewangles.y = 90.0f * (tobuild + 1);
|
||||
current_user_cmd->viewangles.y =
|
||||
90.0f * (tobuild + 1);
|
||||
// Build new one
|
||||
g_IEngine->ServerCmd(format("build ", tobuild).c_str(),
|
||||
true);
|
||||
g_IEngine->ServerCmd(
|
||||
format("build ", tobuild).c_str(), true);
|
||||
current_user_cmd->buttons |= IN_ATTACK;
|
||||
g_pLocalPlayer->bUseSilentAngles = true;
|
||||
}
|
||||
@ -724,7 +735,8 @@ void CreateMove()
|
||||
break;
|
||||
if (entity->m_Type() != ENTITY_PLAYER)
|
||||
continue;
|
||||
if (steamid != entity->player_info.friendsID) // steamid check
|
||||
if (steamid !=
|
||||
entity->player_info.friendsID) // steamid check
|
||||
continue;
|
||||
|
||||
if (!entity->m_bAlivePlayer()) // Dont follow dead players
|
||||
@ -733,11 +745,11 @@ void CreateMove()
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If we dont have a follow target from that, we look again for someone
|
||||
// else who is suitable
|
||||
// If we dont have a follow target from that, we look again for
|
||||
// someone else who is suitable
|
||||
if ((!follow_target || change_tar ||
|
||||
(hacks::shared::followbot::ClassPriority(ENTITY(follow_target)) <
|
||||
6 &&
|
||||
(hacks::shared::followbot::ClassPriority(
|
||||
ENTITY(follow_target)) < 6 &&
|
||||
ENTITY(follow_target)->player_info.friendsID != steamid)) &&
|
||||
roambot)
|
||||
{
|
||||
@ -754,8 +766,8 @@ void CreateMove()
|
||||
continue;
|
||||
if (entity->m_bEnemy())
|
||||
continue;
|
||||
if (afk &&
|
||||
afkTicks[i].check(int(afktime))) // don't follow target that
|
||||
if (afk && afkTicks[i].check(
|
||||
int(afktime))) // don't follow target that
|
||||
// was determined afk
|
||||
continue;
|
||||
if (IsPlayerDisguised(entity) || IsPlayerInvisible(entity))
|
||||
@ -785,7 +797,8 @@ void CreateMove()
|
||||
ENTITY(follow_target)->m_flDistance() <
|
||||
entity->m_flDistance()) // favor closer entitys
|
||||
continue;
|
||||
// check if new target has a higher priority than current target
|
||||
// check if new target has a higher priority than current
|
||||
// target
|
||||
if (hacks::shared::followbot::ClassPriority(
|
||||
ENTITY(follow_target)) >=
|
||||
hacks::shared::followbot::ClassPriority(ENTITY(i)))
|
||||
@ -853,7 +866,8 @@ void CreateMove()
|
||||
}
|
||||
// Check if still moving. 70 HU = Sniper Zoomed Speed
|
||||
if (idle_time.check(3000) &&
|
||||
CE_VECTOR(g_pLocalPlayer->entity, netvar.vVelocity).IsZero(60.0f))
|
||||
CE_VECTOR(g_pLocalPlayer->entity, netvar.vVelocity)
|
||||
.IsZero(60.0f))
|
||||
{
|
||||
follow_target = 0;
|
||||
nav::NavTo(LOCAL_E->m_vecOrigin(), true, false, 4);
|
||||
@ -881,7 +895,8 @@ void CreateMove()
|
||||
|
||||
// Get the follow targets active weapon
|
||||
int owner_weapon_eid =
|
||||
(CE_INT(ENTITY(follow_target), netvar.hActiveWeapon) & 0xFFF);
|
||||
(CE_INT(ENTITY(follow_target), netvar.hActiveWeapon) &
|
||||
0xFFF);
|
||||
IClientEntity *owner_weapon =
|
||||
g_IEntityList->GetClientEntity(owner_weapon_eid);
|
||||
|
||||
@ -894,7 +909,8 @@ void CreateMove()
|
||||
// IsBaseCombatWeapon()
|
||||
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(
|
||||
RAW_ENT(g_pLocalPlayer->weapon())) &&
|
||||
re::C_BaseCombatWeapon::IsBaseCombatWeapon(owner_weapon))
|
||||
re::C_BaseCombatWeapon::IsBaseCombatWeapon(
|
||||
owner_weapon))
|
||||
{
|
||||
|
||||
// Get the players slot numbers and store in some vars
|
||||
@ -903,9 +919,8 @@ void CreateMove()
|
||||
int owner_slot =
|
||||
re::C_BaseCombatWeapon::GetSlot(owner_weapon);
|
||||
|
||||
// If the local player is a medic and user settings allow,
|
||||
// then
|
||||
// keep the medigun out
|
||||
// If the local player is a medic and user settings
|
||||
// allow, then keep the medigun out
|
||||
if (g_pLocalPlayer->clazz == tf_medic && always_medigun)
|
||||
{
|
||||
if (my_slot != 1)
|
||||
@ -913,9 +928,8 @@ void CreateMove()
|
||||
g_IEngine->ExecuteClientCmd("slot2");
|
||||
}
|
||||
|
||||
// Else we attemt to keep our weapon mimiced with our
|
||||
// follow
|
||||
// target
|
||||
// Else we attemt to keep our weapon mimiced with
|
||||
// our follow target
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -930,5 +944,5 @@ void CreateMove()
|
||||
}
|
||||
nav::NavTo(tar_orig, false, true, 5);
|
||||
}
|
||||
}
|
||||
});
|
||||
} // namespace hacks::tf2::NavBot
|
||||
|
@ -1216,8 +1216,10 @@ void OnLevelInit()
|
||||
Timer quit_timer{};
|
||||
Timer map_check{};
|
||||
int erasedelay = 0;
|
||||
void Move()
|
||||
{
|
||||
static HookedFunction
|
||||
Move(HookedFunctions_types::HF_CreateMove, "Walkbot", 16, []() {
|
||||
if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer())
|
||||
return;
|
||||
if (state::state == WB_DISABLED)
|
||||
return;
|
||||
switch (state::state)
|
||||
@ -1240,7 +1242,8 @@ void Move()
|
||||
{
|
||||
if (leave_if_empty)
|
||||
{
|
||||
if (nodes.size() == 0 || g_IEngine->GetLevelName() != prevlvlname)
|
||||
if (nodes.size() == 0 ||
|
||||
g_IEngine->GetLevelName() != prevlvlname)
|
||||
{
|
||||
prevlvlname = g_IEngine->GetLevelName();
|
||||
if (!boost::contains(prevlvlname, "pl_"))
|
||||
@ -1286,5 +1289,5 @@ void Move()
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
} // namespace hacks::shared::walkbot
|
||||
|
@ -109,7 +109,13 @@ static int attackticks = 0;
|
||||
|
||||
namespace hooked_methods
|
||||
{
|
||||
|
||||
static HookedFunction viewangs(HookedFunctions_types::HF_CreateMove, "set_ang",
|
||||
21, []() {
|
||||
if (CE_BAD(LOCAL_E))
|
||||
return;
|
||||
g_pLocalPlayer->v_OrigViewangles =
|
||||
current_user_cmd->viewangles;
|
||||
});
|
||||
DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
CUserCmd *cmd)
|
||||
{
|
||||
@ -249,9 +255,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
g_pLocalPlayer->Update();
|
||||
}
|
||||
g_Settings.bInvalid = false;
|
||||
|
||||
hacks::shared::autojoin::update();
|
||||
|
||||
{
|
||||
PROF_SECTION(CM_AAA);
|
||||
hacks::shared::anti_anti_aim::createMove();
|
||||
@ -261,45 +264,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
PROF_SECTION(CM_WRAPPER);
|
||||
HookTools::CM();
|
||||
}
|
||||
|
||||
#if ENABLE_IPC
|
||||
#if !LAGBOT_MODE
|
||||
if (hacks::shared::followbot::isEnabled())
|
||||
{
|
||||
hacks::shared::followbot::WorldTick();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (CE_GOOD(g_pLocalPlayer->entity))
|
||||
{
|
||||
#if !LAGBOT_MODE
|
||||
IF_GAME(IsTF2())
|
||||
{
|
||||
UpdateHoovyList();
|
||||
}
|
||||
g_pLocalPlayer->v_OrigViewangles = cmd->viewangles;
|
||||
#if ENABLE_VISUALS
|
||||
{
|
||||
PROF_SECTION(CM_esp);
|
||||
hacks::shared::esp::CreateMove();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
|
||||
{
|
||||
#if !LAGBOT_MODE
|
||||
{
|
||||
PROF_SECTION(CM_walkbot);
|
||||
hacks::shared::walkbot::Move();
|
||||
}
|
||||
{
|
||||
PROF_SECTION(CM_navparse);
|
||||
nav::CreateMove();
|
||||
}
|
||||
{
|
||||
PROF_SECTION(CM_navbot);
|
||||
hacks::tf2::NavBot::CreateMove();
|
||||
}
|
||||
// Walkbot can leave game.
|
||||
if (!g_IEngine->IsInGame())
|
||||
{
|
||||
|
13
src/hoovy.cpp
Executable file → Normal file
13
src/hoovy.cpp
Executable file → Normal file
@ -37,11 +37,14 @@ bool IsHoovyHelper(CachedEntity *entity)
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateHoovyList()
|
||||
{
|
||||
static CachedEntity *ent;
|
||||
static HookedFunction UpdateHoovyList(
|
||||
HookedFunctions_types::HF_CreateMove, "HoovyList", 19, []() {
|
||||
if (CE_BAD(LOCAL_E))
|
||||
return;
|
||||
|
||||
for (int i = 1; i < 32 && i < g_IEntityList->GetHighestEntityIndex(); i++)
|
||||
static CachedEntity *ent;
|
||||
for (int i = 1; i < 32 && i < g_IEntityList->GetHighestEntityIndex();
|
||||
i++)
|
||||
{
|
||||
ent = ENTITY(i);
|
||||
if (CE_GOOD(ent) && CE_BYTE(ent, netvar.iLifeState) == LIFE_ALIVE)
|
||||
@ -58,7 +61,7 @@ void UpdateHoovyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bool IsHoovy(CachedEntity *entity)
|
||||
{
|
||||
|
@ -367,8 +367,8 @@ void Repath()
|
||||
}
|
||||
|
||||
// Main movement function, gets path from NavTo
|
||||
void CreateMove()
|
||||
{
|
||||
static HookedFunction
|
||||
CreateMove(HookedFunctions_types::HF_CreateMove, "NavParser", 17, []() {
|
||||
if (!enabled || !threadingFinished.load())
|
||||
return;
|
||||
if (CE_BAD(LOCAL_E))
|
||||
@ -390,8 +390,8 @@ void CreateMove()
|
||||
}
|
||||
ReadyForCommands = false;
|
||||
// Remove old crumbs
|
||||
if (g_pLocalPlayer->v_Origin.DistTo(Vector{ crumbs.at(0).x, crumbs.at(0).y,
|
||||
g_pLocalPlayer->v_Origin.z }) <
|
||||
if (g_pLocalPlayer->v_Origin.DistTo(Vector{
|
||||
crumbs.at(0).x, crumbs.at(0).y, g_pLocalPlayer->v_Origin.z }) <
|
||||
30.0f)
|
||||
{
|
||||
lastArea = crumbs.at(0);
|
||||
@ -428,8 +428,8 @@ void CreateMove()
|
||||
{
|
||||
// Ignore connection
|
||||
bool resetPather = false;
|
||||
TF2MAP->inactiveTracker.AddTime({ lastArea, crumbs.at(0) }, inactivity,
|
||||
resetPather);
|
||||
TF2MAP->inactiveTracker.AddTime({ lastArea, crumbs.at(0) },
|
||||
inactivity, resetPather);
|
||||
if (resetPather)
|
||||
TF2MAP->pather->Reset();
|
||||
Repath();
|
||||
@ -438,7 +438,7 @@ void CreateMove()
|
||||
}
|
||||
// Walk to next crumb
|
||||
WalkTo(crumbs.at(0));
|
||||
}
|
||||
});
|
||||
|
||||
void Draw()
|
||||
{
|
||||
|
Reference in New Issue
Block a user