Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------------------
- void __stdcall hkRunCommand(C_BasePlayer *m_pPlayer, CUserCmd *m_nCmd, IMoveHelper *moveHelper)
- {
- static auto oRunCommand = prediction_hook.get_original<RunCommand_t>(index::RunCommand);
- if (m_pPlayer->EntIndex() == g_EngineClient->GetLocalPlayer())
- {
- if (!m_pPlayer->m_hActiveWeapon().Get())
- return;
- if (m_nCmd->tick_count > g_GlobalVars->tickcount + 50)
- {
- g_LocalPlayer->m_nTickBase() -= m_iTickbaseDifference;
- g_GlobalVars->curtime = g_LocalPlayer->m_nTickBase() * g_GlobalVars->interval_per_tick;
- }
- float m_flBackupVelMod = *(float*)((uintptr_t)m_pPlayer + 0xA38C);
- float m_flCurtime = g_GlobalVars->curtime;
- if (m_pPlayer->m_fFlags() & FL_ONGROUND)
- g_Animations.VelocityModifier();
- g_Animations.Viewmodel();
- engineprediction::Get().on_run_command();
- m_nCmd->hasbeenpredicted = true;
- oRunCommand(g_Prediction, m_pPlayer, m_nCmd, moveHelper);
- g_GlobalVars->curtime = m_flCurtime;
- *(float*)((uintptr_t)m_pPlayer + 0xA38C) = m_flBackupVelMod;
- *(uint32_t*)((uint32_t)m_pPlayer + 0x3334) = NULL;
- }
- else
- return oRunCommand(g_Prediction, m_pPlayer, m_nCmd, moveHelper);
- }
- //--------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement