more stuff
This commit is contained in:
parent
788751864e
commit
b70ab82cbe
@ -38,7 +38,7 @@ CatCommand follow_steam("fb_steam", "Follow Steam Id",
|
||||
steamid = 0x0;
|
||||
return;
|
||||
}
|
||||
steamid = atol(args.Arg(1));
|
||||
steamid = std::stoul(args.Arg(1));
|
||||
});
|
||||
|
||||
// Something to store breadcrumbs created by followed players
|
||||
|
@ -38,7 +38,7 @@ CatCommand follow_steam("navbot_steam", "Follow Steam Id",
|
||||
steamid = 0x0;
|
||||
return;
|
||||
}
|
||||
steamid = atol(args.Arg(1));
|
||||
steamid = std::stoul(args.Arg(1));
|
||||
});
|
||||
Timer lastTaunt{}; // time since taunt was last executed, used to avoid kicks
|
||||
Timer lastJump{};
|
||||
@ -535,28 +535,27 @@ static HookedFunction
|
||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bestscr = INT_MAX;
|
||||
hacks::shared::backtrack::BacktrackData besttick{};
|
||||
for (auto i : hacks::shared::backtrack::
|
||||
headPositions[tar->m_IDX])
|
||||
{
|
||||
if (!hacks::shared::backtrack::ValidTick(i,
|
||||
tar))
|
||||
{
|
||||
int scr = i.tickcount;
|
||||
if (scr < bestscr)
|
||||
{
|
||||
bestscr = scr;
|
||||
besttick = i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
auto unsorted_ticks = hacks::shared::backtrack::headPositions[tar->m_IDX];
|
||||
std::vector<hacks::shared::backtrack::BacktrackData> sorted_ticks;
|
||||
for (int i = 0; i < 66; i++) {
|
||||
if (hacks::shared::backtrack::ValidTick(unsorted_ticks[i], tar))
|
||||
sorted_ticks.push_back(unsorted_ticks[i]);
|
||||
}
|
||||
if (besttick.tickcount)
|
||||
nav::NavTo(besttick.entorigin, false, false);
|
||||
else if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
if (sorted_ticks.empty()) {
|
||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
return;
|
||||
}
|
||||
std::sort(sorted_ticks.begin(), sorted_ticks.end(),
|
||||
[](const hacks::shared::backtrack::BacktrackData &a,
|
||||
const hacks::shared::backtrack::BacktrackData &b) {
|
||||
return a.tickcount > b.tickcount;
|
||||
});
|
||||
|
||||
if (!sorted_ticks[5].tickcount || nav::NavTo(sorted_ticks[5].entorigin, false, false))
|
||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,11 +75,9 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
||||
for (int i = 0; i < buf.GetNumBytesLeft(); i++)
|
||||
{
|
||||
int byte = buf.ReadByte();
|
||||
if (byte == 0)
|
||||
break;
|
||||
message_name.push_back(byte);
|
||||
}
|
||||
if (message_name.find("TF_Autobalance_TeamChangePending") !=
|
||||
if (message_name.find("#TF_Autobalance_TeamChangePending") !=
|
||||
std::string::npos)
|
||||
logging::Info("test, %d %d", int(message_name[0]),
|
||||
(CE_GOOD(LOCAL_E) ? LOCAL_E->m_IDX : -1));
|
||||
|
Reference in New Issue
Block a user