Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static float next_lby_update_time = 0;
- float get_curtime(CUserCmd* ucmd) {
- auto local_player = Globals::LocalPlayer;
- if (!local_player)
- return 0;
- int g_tick = 0;
- CUserCmd* g_pLastCmd = nullptr;
- if (!g_pLastCmd || g_pLastCmd->hasbeenpredicted) {
- g_tick = (float)local_player->GetTickBase();
- }
- else {
- ++g_tick;
- }
- g_pLastCmd = ucmd;
- float curtime = g_tick * g_pGlobalVars->intervalPerTick;
- return curtime;
- }
- bool next_lby_update(const float yaw_to_break, CUserCmd* cmd)
- {
- auto local_player = Globals::LocalPlayer;
- if (!local_player)
- return false;
- static float next_lby_update_time = 0;
- float curtime = get_curtime(cmd);
- auto animstate = local_player->AnimState();
- if (!animstate)
- return false;
- if (!(local_player->GetFlags() & FL_ONGROUND))
- return false;
- if (animstate->speed_2d > 0.1)
- next_lby_update_time = curtime + 0.22f;
- if (next_lby_update_time < curtime)
- {
- next_lby_update_time = curtime + 1.1f;
- return true;
- }
- return false;
- }
- bool m_bAutomaticDir = false;
- int m_iAutoDirection = 0;
- int m_iJitter = 0;
- int m_iJitterIteration = 0;
- float m_flCurrentFeetYaw = 0.0f;
- float m_flPreviousFeetYaw = 0.0f;
Add Comment
Please, Sign In to add comment