bool next_lby_update(const float yaw_to_break, sdk::CUserCmd* cmd)
{
auto local_player = ctx::client_ent_list->GetClientEntity(ctx::engine->GetLocalPlayer());
if (!local_player)
return false;
static float next_lby_update_time = 0;
// yo the immigrant retard, we have to get predicted curtime for the lby breaker to work
// yo the alipine retard, you already predict it in EngPred.cpp so why do it again.
float curtime = ctx::globals->curtime;
local_update = next_lby_update_time;
auto animstate = local_player->GetAnimState();
if (!animstate)
return false;
if (!(local_player->GetFlags() & FL_ONGROUND))
return false;
//in the sdk they dont use doubles. so im just gonna make this speed a float :)
//ik the breaker works but its more proper
if (animstate->speed_2d > 0.1f && !fake_walk)
{
next_lby_update_time = curtime + 0.22f;
}
if (next_lby_update_time < curtime)
{
next_lby_update_time = curtime + 1.1f;
return true;
}
return false;
}
if (Vars::options.lby_breaker_bool)
{
static float last_real;
float lbydelta = Vars::options.delta_val;
if (!GLOBAL::should_send_packet)
{
if (next_lby_update(cmd->viewangles.y - lbydelta, cmd)) {
cmd->viewangles.y = last_real - lbydelta;
}
last_real = cmd->viewangles.y;
}
}