improvements
This commit is contained in:
parent
f3209601f8
commit
7c563ccff5
@ -133,7 +133,7 @@ std::optional<colors::rgba_t> forceEspColorSteamId(unsigned id)
|
||||
}
|
||||
#endif
|
||||
|
||||
return std::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
std::optional<colors::rgba_t> forceEspColor(CachedEntity *entity)
|
||||
{
|
||||
|
@ -124,7 +124,8 @@ void NetVars::Init()
|
||||
this->m_bBuilding = gNetvars.get_offset("DT_BaseObject", "m_hBuilding");
|
||||
this->m_iObjectType =
|
||||
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
|
||||
this->m_bHasSapper = gNetvars.get_offset("DT_BaseObject", "m_bHasSapper");
|
||||
this->m_bHasSapper =
|
||||
gNetvars.get_offset("DT_BaseObject", "m_bHasSapper");
|
||||
this->m_bMiniBuilding =
|
||||
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
|
||||
this->m_iTeleState =
|
||||
|
@ -210,7 +210,9 @@ void CreateMove()
|
||||
|
||||
// flNextPrimaryAttack meme
|
||||
// target_eid = target_entity->m_IDX;
|
||||
if (only_can_shoot && g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFMinigun) && g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFLaserPointer))
|
||||
if (only_can_shoot &&
|
||||
g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFMinigun) &&
|
||||
g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFLaserPointer))
|
||||
{
|
||||
|
||||
// Handle Compound bow
|
||||
@ -823,8 +825,9 @@ void DoAutoshoot()
|
||||
float chargebegin = *((float *) ((unsigned) RAW_ENT(LOCAL_W) + 3152));
|
||||
float chargetime = g_GlobalVars->curtime - chargebegin;
|
||||
|
||||
// Release Sticky if > chargetime, 3.85 is the max second chargetime, but we want a percent so here we go
|
||||
if ((chargetime >= *sticky_autoshoot / 3.85f) && begansticky > 3)
|
||||
// Release Sticky if > chargetime, 3.85 is the max second chargetime,
|
||||
// but we want a percent so here we go
|
||||
if ((chargetime >= 3.85f / *sticky_autoshoot) && begansticky > 3)
|
||||
{
|
||||
current_user_cmd->buttons &= ~IN_ATTACK;
|
||||
hacks::shared::antiaim::SetSafeSpace(3);
|
||||
|
@ -1039,8 +1039,8 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
|
||||
? "Teleporter"
|
||||
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
|
||||
: "Dispenser"));
|
||||
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
||||
bool IsMini = CE_BYTE(ent, netvar.m_bMiniBuilding);
|
||||
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
||||
bool IsMini = CE_BYTE(ent, netvar.m_bMiniBuilding);
|
||||
bool IsSapped = CE_BYTE(ent, netvar.m_bHasSapper);
|
||||
if (!IsMini)
|
||||
AddEntityString(ent, format("LV ", level, ' ', name));
|
||||
|
@ -535,25 +535,36 @@ static HookedFunction
|
||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
}
|
||||
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))
|
||||
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 (sorted_ticks.empty()) {
|
||||
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;
|
||||
});
|
||||
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 (!sorted_ticks[5].tickcount ||
|
||||
nav::NavTo(sorted_ticks[5].entorigin, false,
|
||||
false))
|
||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||
last_tar = -1;
|
||||
}
|
||||
|
@ -22,13 +22,14 @@ static Timer sendmsg{};
|
||||
static Timer gitgud{};
|
||||
|
||||
// Using repeated char causes crash on some systems. Suboptimal solution.
|
||||
const static std::string
|
||||
clear("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
const static std::string clear(
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
std::string lastfilter{};
|
||||
std::string lastname{};
|
||||
|
||||
@ -103,16 +104,14 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
||||
std::string message{};
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
int starcount = 0;
|
||||
while ((c = data[j++]) && (loop_index < s))
|
||||
{
|
||||
loop_index++;
|
||||
if (clean_chat)
|
||||
{
|
||||
if ((c == '\n' || c == '\r') && (i == 1 || i == 2))
|
||||
{
|
||||
data[j - 1] = '*';
|
||||
starcount++;
|
||||
}
|
||||
data[j - 1] = '\0';
|
||||
}
|
||||
if (i == 1)
|
||||
name.push_back(c);
|
||||
if (i == 2)
|
||||
@ -185,7 +184,7 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
||||
if (boost::contains(message2, filter) && !filtered)
|
||||
{
|
||||
filtered = true;
|
||||
chat_stack::Say(". " + clear, true);
|
||||
chat_stack::Say("." + clear, true);
|
||||
retrun = true;
|
||||
lastfilter = format(filter);
|
||||
lastname = format(name);
|
||||
|
Reference in New Issue
Block a user