Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. //--------------------------------------------------------------------------------
  2. void __stdcall hkRunCommand(C_BasePlayer *m_pPlayer, CUserCmd *m_nCmd, IMoveHelper *moveHelper)
  3. {
  4. static auto oRunCommand = prediction_hook.get_original<RunCommand_t>(index::RunCommand);
  5.  
  6. if (m_pPlayer->EntIndex() == g_EngineClient->GetLocalPlayer())
  7. {
  8. if (!m_pPlayer->m_hActiveWeapon().Get())
  9. return;
  10.  
  11. if (m_nCmd->tick_count > g_GlobalVars->tickcount + 50)
  12. {
  13. g_LocalPlayer->m_nTickBase() -= m_iTickbaseDifference;
  14. g_GlobalVars->curtime = g_LocalPlayer->m_nTickBase() * g_GlobalVars->interval_per_tick;
  15. }
  16.  
  17. float m_flBackupVelMod = *(float*)((uintptr_t)m_pPlayer + 0xA38C);
  18. float m_flCurtime = g_GlobalVars->curtime;
  19.  
  20. if (m_pPlayer->m_fFlags() & FL_ONGROUND)
  21. g_Animations.VelocityModifier();
  22.  
  23. g_Animations.Viewmodel();
  24. engineprediction::Get().on_run_command();
  25.  
  26. m_nCmd->hasbeenpredicted = true;
  27. oRunCommand(g_Prediction, m_pPlayer, m_nCmd, moveHelper);
  28.  
  29. g_GlobalVars->curtime = m_flCurtime;
  30. *(float*)((uintptr_t)m_pPlayer + 0xA38C) = m_flBackupVelMod;
  31. *(uint32_t*)((uint32_t)m_pPlayer + 0x3334) = NULL;
  32. }
  33. else
  34. return oRunCommand(g_Prediction, m_pPlayer, m_nCmd, moveHelper);
  35. }
  36. //--------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement